You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per documentation, the math.Round "returns the nearest integer" [1]. Why does it return it in a float? [2] Wouldn't make more sense to return it in an integer typed variable?
The output of math.Round is most likely to be used with other functions in the math package, which all operate on floats. math.Floor exists for the same reason. It wouldn't be necessary if it returned int.
As per documentation, the math.Round "returns the nearest integer" [1]. Why does it return it in a float? [2] Wouldn't make more sense to return it in an integer typed variable?
[1]
go/src/math/floor.go
Line 58 in 6104939
[2]
go/src/math/floor.go
Line 64 in 6104939
The text was updated successfully, but these errors were encountered: