mirror of
https://github.com/golang/go
synced 2024-11-18 07:04:52 -07:00
runtime: copy sqrt normalization bugfix from math
This copies the change from CL 16158 (applied as
22d4c8bf13
).
Updates #13013
Change-Id: Id7d02e63d92806f06a4e064a91b2fb6574fe385f
Reviewed-on: https://go-review.googlesource.com/16291
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
75a423a983
commit
fb7178e7cc
@ -117,7 +117,7 @@ func sqrt(ix uint64) uint64 {
|
||||
// normalize x
|
||||
exp := int((ix >> float64Shift) & float64Mask)
|
||||
if exp == 0 { // subnormal x
|
||||
for ix&1<<float64Shift == 0 {
|
||||
for ix&(1<<float64Shift) == 0 {
|
||||
ix <<= 1
|
||||
exp--
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ var vfsqrtSC = []float64{
|
||||
0,
|
||||
math.Inf(1),
|
||||
math.NaN(),
|
||||
math.Float64frombits(2),
|
||||
}
|
||||
var sqrtSC = []float64{
|
||||
math.NaN(),
|
||||
@ -82,4 +83,5 @@ var sqrtSC = []float64{
|
||||
0,
|
||||
math.Inf(1),
|
||||
math.NaN(),
|
||||
3.1434555694052576e-162,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user