reflect: stop thinking that MaxFloat32 overflows float32.

Fixes #4282.

R=golang-dev, minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6759052
This commit is contained in:
Rémy Oudompheng 2012-10-26 08:39:36 +02:00
parent 320df44f04
commit 38070a72c5
2 changed files with 40 additions and 1 deletions

View file

@ -1179,7 +1179,7 @@ func overflowFloat32(x float64) bool {
if x < 0 {
x = -x
}
return math.MaxFloat32 <= x && x <= math.MaxFloat64
return math.MaxFloat32 < x && x <= math.MaxFloat64
}
// OverflowInt returns true if the int64 x cannot be represented by v's type.