mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
320df44f04
commit
38070a72c5
2 changed files with 40 additions and 1 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue