Commit 9282a768 authored by Russ Cox's avatar Russ Cox

math: s/MinFloat/SmallestNonzeroFloat/

R=r, gri
CC=golang-dev
https://golang.org/cl/3547042
parent e454af4d
...@@ -2263,9 +2263,9 @@ type floatTest struct { ...@@ -2263,9 +2263,9 @@ type floatTest struct {
var floatTests = []floatTest{ var floatTests = []floatTest{
{float64(MaxFloat64), "MaxFloat64", "1.7976931348623157e+308"}, {float64(MaxFloat64), "MaxFloat64", "1.7976931348623157e+308"},
{float64(MinFloat64), "MinFloat64", "5e-324"}, {float64(SmallestNonzeroFloat64), "SmallestNonzeroFloat64", "5e-324"},
{float32(MaxFloat32), "MaxFloat32", "3.4028235e+38"}, {float32(MaxFloat32), "MaxFloat32", "3.4028235e+38"},
{float32(MinFloat32), "MinFloat32", "1e-45"}, {float32(SmallestNonzeroFloat32), "SmallestNonzeroFloat32", "1e-45"},
} }
func TestFloatMinMax(t *testing.T) { func TestFloatMinMax(t *testing.T) {
......
...@@ -25,13 +25,13 @@ const ( ...@@ -25,13 +25,13 @@ const (
// Floating-point limit values. // Floating-point limit values.
// Max is the largest finite value representable by the type. // Max is the largest finite value representable by the type.
// Min is the smallest nonzero value representable by the type. // SmallestNonzero is the smallest positive, non-zero value representable by the type.
const ( const (
MaxFloat32 = 3.40282346638528859811704183484516925440e+38 /* 2**127 * (2**24 - 1) / 2**23 */ MaxFloat32 = 3.40282346638528859811704183484516925440e+38 /* 2**127 * (2**24 - 1) / 2**23 */
MinFloat32 = 1.401298464324817070923729583289916131280e-45 /* 1 / 2**(127 - 1 + 23) */ SmallestNonzeroFloat32 = 1.401298464324817070923729583289916131280e-45 /* 1 / 2**(127 - 1 + 23) */
MaxFloat64 = 1.797693134862315708145274237317043567981e+308 /* 2**1023 * (2**53 - 1) / 2**52 */ MaxFloat64 = 1.797693134862315708145274237317043567981e+308 /* 2**1023 * (2**53 - 1) / 2**52 */
MinFloat64 = 4.940656458412465441765687928682213723651e-324 /* 1 / 2**(1023 - 1 + 52) */ SmallestNonzeroFloat64 = 4.940656458412465441765687928682213723651e-324 /* 1 / 2**(1023 - 1 + 52) */
) )
// Integer limit values. // Integer limit values.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment