diff options
author | Akhil Indurti <aindurti@gmail.com> | 2023-02-10 19:08:14 -0800 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2023-02-15 21:56:30 +0000 |
commit | 3348fd0ec9be0189f88e991db1d94f437ec04bd1 (patch) | |
tree | 2e44bb03dff98911d45542bb95e933a93d1f0d1a /api | |
parent | 40ed3591829f67e7a116180aec543dd15bfcf5f9 (diff) | |
download | go-git-3348fd0ec9be0189f88e991db1d94f437ec04bd1.tar.gz |
math: add Compare and Compare32
This change introduces the Compare and Compare32 functions
based on the total-ordering predicate in IEEE-754, section 5.10.
In particular,
* -NaN is ordered before any other value
* +NaN is ordered after any other value
* -0 is ordered before +0
* All other values are ordered the usual way
Compare-8 0.4537n ± 1%
Compare32-8 0.3752n ± 1%
geomean 0.4126n
Fixes #56491.
Change-Id: I5c9c77430a2872f380688c1b0a66f2105b77d5ac
Reviewed-on: https://go-review.googlesource.com/c/go/+/467515
Reviewed-by: WANG Xuerui <git@xen0n.name>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'api')
-rw-r--r-- | api/next/56491.txt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/api/next/56491.txt b/api/next/56491.txt new file mode 100644 index 0000000000..333f92e215 --- /dev/null +++ b/api/next/56491.txt @@ -0,0 +1,2 @@ +pkg math, func Compare(float64, float64) int #56491 +pkg math, func Compare32(float32, float32) int #56491 |