diff options
| author | Dan Kortschak <dan@kortschak.io> | 2021-12-21 21:49:50 +1030 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2022-03-05 21:19:15 +0000 |
| commit | 2981fc7f1676ca79e487ba3c1df06e5e60723483 (patch) | |
| tree | 80c5dd44c1e0b6c6c86c1cad534a3cae97216904 /src | |
| parent | 55a60cadc3f5d01f76ac9435da2ed941e194a29b (diff) | |
| download | go-2981fc7f1676ca79e487ba3c1df06e5e60723483.tar.xz | |
math: don't use integer division that truncates to zero
Change-Id: I7389da0c3a63fea3be5c820f2ce0d0168a95ab4c
Reviewed-on: https://go-review.googlesource.com/c/go/+/373377
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/math/all_test.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/math/all_test.go b/src/math/all_test.go index c11d823233..8d5e0ad439 100644 --- a/src/math/all_test.go +++ b/src/math/all_test.go @@ -1631,8 +1631,8 @@ var vfpowSC = [][2]float64{ {-1, Inf(-1)}, {-1, Inf(1)}, {-1, NaN()}, - {-1 / 2, Inf(-1)}, - {-1 / 2, Inf(1)}, + {-0.5, Inf(-1)}, + {-0.5, Inf(1)}, {Copysign(0, -1), Inf(-1)}, {Copysign(0, -1), -Pi}, {Copysign(0, -1), -0.5}, @@ -1652,8 +1652,8 @@ var vfpowSC = [][2]float64{ {0, Inf(1)}, {0, NaN()}, - {1 / 2, Inf(-1)}, - {1 / 2, Inf(1)}, + {0.5, Inf(-1)}, + {0.5, Inf(1)}, {1, Inf(-1)}, {1, Inf(1)}, {1, NaN()}, @@ -1681,8 +1681,8 @@ var vfpowSC = [][2]float64{ {2, float64(1 << 32)}, {2, -float64(1 << 32)}, {-2, float64(1<<32 + 1)}, - {1 / 2, float64(1 << 45)}, - {1 / 2, -float64(1 << 45)}, + {0.5, float64(1 << 45)}, + {0.5, -float64(1 << 45)}, {Nextafter(1, 2), float64(1 << 63)}, {Nextafter(1, -2), float64(1 << 63)}, {Nextafter(-1, 2), float64(1 << 63)}, |
