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
x and y must have a non-empty mantissa and valid exponent.
and there's no input checking for +Inf values. Unfortunately p.pow10(exp10)can be Inf (when exp10 is big).
When Parse is called with 1e81391777742999, this results in a call to pow10 that returns an Inf Float. Then umul is called as umul(1, +Inf) and happily returns a bogus value of 1e151.
The fix is simple: if the umul call on line 130 is replaced with a Mul call (which does Inf checking), then
the expected value (with exponent 1538481529) is wrong. 1e1000000000 is not representable as a floating point number with int32 exponent. Again, what is coded as the expected result is a bogus number returned by an umul call with an Inf parameter.
proves that negative exponents too are mis-handled. In fact, 1e-81391777742999 returns 1e-151. This problem, too, can be fixed by replacing a uquo call (no Inf checking), with a Quo, in line 128 of floatconv.go
prints x = 1e+151 which is incorrect.
The text was updated successfully, but these errors were encountered: