aboutsummaryrefslogtreecommitdiff
path: root/src/math/const.go
AgeCommit message (Collapse)Author
2022-09-21math: show value of integer constants in commentsShulhan
Fixes #51282 Change-Id: I5b0d68165b727a427bd4a42663b2fa0070ced22f Reviewed-on: https://go-review.googlesource.com/c/go/+/343990 Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-05-03math: add MaxUint, MinInt, MaxIntColin Arnott
Since we have int8 to int64 min max and uint8 to uint64 max constants, we should probably have some for the word size types too. This change also adds tests to validate the correctness of all integer limit values. Fixes #28538 Change-Id: Idd25782e98d16c2abedf39959b7b66e9c4c0c98b Reviewed-on: https://go-review.googlesource.com/c/go/+/247058 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Robert Griesemer <gri@golang.org>
2021-05-03math: replace float32/64 extrema with exact expressionsRobert Griesemer
Follow-up on https://golang.org/cl/315170. Updates #44057. Updates #44058. Change-Id: I0b071e8ee7a1c97aae2436945cc9583cde3b40b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/315969 Trust: Robert Griesemer <gri@golang.org> Trust: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Russ Cox <rsc@golang.org>
2021-04-30math: increase precision of math.SmallestNonzeroFloat64Robert Griesemer
The original value was rounded too early, which lead to the surprising behavior that float64(math.SmallestNonzeroFloat64 / 2) wasn't 0. That is, the exact compile-time computation of math.SmallestNonzeroFloat64 / 2 resulted in a value that was rounded up when converting to float64. To address this, added 3 more digits to the mantissa, ending in a 0. While at it, also slightly increased the precision of MaxFloat64 to end in a 0. Computed exact values via https://play.golang.org/p/yt4KTpIx_wP. Added a test to verify expected behavior. In contrast to the other (irrational) constants, expanding these extreme values to more digits is unlikely to be important as they are not going to appear in numeric computations except for tests verifying their correctness (as is the case here). Re-enabled a disabled test in go/types and types2. Updates #44057. Fixes #44058. Change-Id: I8f363155e02331354e929beabe993c8d8de75646 Reviewed-on: https://go-review.googlesource.com/c/go/+/315170 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-08-08math: change oeis.org urls to httpsJelte Fennema
Regular HTTP is insecure, oeis.org supports HTTPS and it is actually used in some other places in the codebase. This changes these final urls to use HTTPS. Change-Id: Ia46410a9c7ce67238a10cb6bfffaceca46112f58 Reviewed-on: https://go-review.googlesource.com/52072 Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com>
2017-06-06math: clarify comment about bit-identical results across architecturesIan Lance Taylor
Updates #18354. Change-Id: I76bc4a73d8dc99eeda14b395e451d75a65184191 Reviewed-on: https://go-review.googlesource.com/45013 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Rob Pike <r@golang.org>
2017-06-06math: add doc note about floating point operationgulyasm
Go doesn't guarantee that the result of floating point operations will be the same on different architectures. It was not stated in the documentation, that can lead to confusion. Fixes #18354 Change-Id: Idb1b4c256fb9a7158a74256136eca3b8ce44476f Reviewed-on: https://go-review.googlesource.com/34938 Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-06-26math: explain OEIS linkAndrew Gerrand
Fixes #10236 Change-Id: Ife85513efda48af81c267b753da2ac7317cdfe75 Reviewed-on: https://go-review.googlesource.com/11479 Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2014-09-08build: move package sources from src/pkg to srcRuss Cox
Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.