• Brian Kessler's avatar
    math: correct result for Pow(x, ±.5) · 5305bdd8
    Brian Kessler authored
    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/85660Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    Run-TryBot: Robert Griesemer <gri@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    5305bdd8
pow.go 3.22 KB