Skip to content

pointless-integer-math

Default severity: warning

An integer converted to floating point is already integral and finite. Rounding it with math.Ceil, math.Floor, or math.Trunc, or testing it with math.IsNaN or math.IsInf, cannot provide useful information.

rounded := math.Ceil(float64(count))
rounded := math.Ceil(measurement)