X Tutup
Skip to content

Commit fa85a72

Browse files
committed
math/big: remove NaN support - just not worth it
NaNs make the API more complicated for no real good reasons. There are few operations that produce NaNs with IEEE arithmetic, there's no need to copy the behavior. It's easy to test for these scenarios and avoid them (on the other hand, it's not easy to test for overflow or underflow, so we want to keep +/-Inf). Also: - renamed IsNeg -> Signbit (clearer, especially for x == -0) - removed IsZero (Sign() == 0 is sufficient and efficient) - removed IsFinite (now same as !IsInf) Change-Id: I3f3b4445c325d9bbb1bf46ce2e298a6aeb498e07 Reviewed-on: https://go-review.googlesource.com/8280 Reviewed-by: Alan Donovan <adonovan@google.com>
1 parent 67426a8 commit fa85a72

File tree

7 files changed

+210
-337
lines changed

7 files changed

+210
-337
lines changed

src/math/big/accuracy_string.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ package big
44

55
import "fmt"
66

7-
const _Accuracy_name = "ExactBelowAboveUndef"
7+
const _Accuracy_name = "BelowExactAbove"
88

9-
var _Accuracy_index = [...]uint8{0, 5, 10, 15, 20}
9+
var _Accuracy_index = [...]uint8{0, 5, 10, 15}
1010

1111
func (i Accuracy) String() string {
12+
i -= -1
1213
if i < 0 || i+1 >= Accuracy(len(_Accuracy_index)) {
13-
return fmt.Sprintf("Accuracy(%d)", i)
14+
return fmt.Sprintf("Accuracy(%d)", i+-1)
1415
}
1516
return _Accuracy_name[_Accuracy_index[i]:_Accuracy_index[i+1]]
1617
}

0 commit comments

Comments
 (0)
X Tutup