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
This is because it returns int64Val(0) when x == 0. It should probably return floatVal0 instead, or maybe a new ratVal0 value (so that match continues using big.Rat arithmetic instead of falling back to big.Float).
The documentation for
MakeFloat64
says it returns aFloat
value: https://golang.org/pkg/go/constant/#MakeFloat64But
MakeFloat64(0).Kind()
returnsconstant.Int
, rather thanconstant.Float
: https://play.golang.org/p/9TLXDgpld9SThis is because it returns
int64Val(0)
whenx == 0
. It should probably returnfloatVal0
instead, or maybe a newratVal0
value (so thatmatch
continues usingbig.Rat
arithmetic instead of falling back tobig.Float
)./cc @griesemer
The text was updated successfully, but these errors were encountered: