]> Cypherpunks repositories - gostls13.git/commit
math: correct result for Pow(x, ±.5)
authorBrian Kessler <brian.m.kessler@gmail.com>
Sat, 30 Dec 2017 08:27:28 +0000 (01:27 -0700)
committerRobert Griesemer <gri@golang.org>
Tue, 2 Jan 2018 18:10:43 +0000 (18:10 +0000)
commit5305bdd86bbe31d61c72e62f4e6729e3562ae178
tree388f4bba9ccf40521e1c20b4b8e2945f2dcca5ad
parent6317adeed7815ad335e2e97c463a7c3c4d82fc19
math: correct result for Pow(x, ±.5)

Fixes #23224

The previous Pow code had an optimization for
powers equal to ±0.5 that used Sqrt for
increased accuracy/speed.  This caused special
cases involving powers of ±0.5 to disagree with
the Pow spec.  This change places the Sqrt optimization
after all of the special case handling.

Change-Id: I6bf757f6248256b29cc21725a84e27705d855369
Reviewed-on: https://go-review.googlesource.com/85660
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/math/all_test.go
src/math/pow.go