mirror of https://github.com/golang/go.git
Merge a60f722838 into 49cdf0c42e
This commit is contained in:
commit
b70b4ccaae
|
|
@ -162,7 +162,7 @@ func quotToFloat32(stk *stack, a, b nat) (f float32, exact bool) {
|
|||
mantissa >>= 1 // discard rounding bit. Mantissa now scaled by 1<<Msize1.
|
||||
|
||||
f = float32(math.Ldexp(float64(mantissa), exp-Msize1))
|
||||
if math.IsInf(float64(f), 0) {
|
||||
if math.IsInf(float64(f), 0) || f == 0 {
|
||||
exact = false
|
||||
}
|
||||
return
|
||||
|
|
@ -260,7 +260,7 @@ func quotToFloat64(stk *stack, a, b nat) (f float64, exact bool) {
|
|||
mantissa >>= 1 // discard rounding bit. Mantissa now scaled by 1<<Msize1.
|
||||
|
||||
f = math.Ldexp(float64(mantissa), exp-Msize1)
|
||||
if math.IsInf(f, 0) {
|
||||
if math.IsInf(f, 0) || f == 0 {
|
||||
exact = false
|
||||
}
|
||||
return
|
||||
|
|
|
|||
|
|
@ -466,6 +466,11 @@ var float64inputs = []string{
|
|||
"-1152921504606846977", // -(1<<60 + 1)
|
||||
|
||||
"1/3",
|
||||
|
||||
"170141183460469231731687303715884105728p-48317",
|
||||
"0000000000000000000000000000031768211457p-9818716",
|
||||
"00000000000000000000000000000000000000000000000000000000001662320182p-801401",
|
||||
"818p-8818873",
|
||||
}
|
||||
|
||||
// isFinite reports whether f represents a finite rational value.
|
||||
|
|
|
|||
Loading…
Reference in New Issue