Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
9282a768
Commit
9282a768
authored
Dec 10, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
math: s/MinFloat/SmallestNonzeroFloat/
R=r, gri CC=golang-dev
https://golang.org/cl/3547042
parent
e454af4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
src/pkg/math/all_test.go
src/pkg/math/all_test.go
+2
-2
src/pkg/math/const.go
src/pkg/math/const.go
+5
-5
No files found.
src/pkg/math/all_test.go
View file @
9282a768
...
...
@@ -2263,9 +2263,9 @@ type floatTest struct {
var
floatTests
=
[]
floatTest
{
{
float64
(
MaxFloat64
),
"MaxFloat64"
,
"1.7976931348623157e+308"
},
{
float64
(
MinFloat64
),
"Min
Float64"
,
"5e-324"
},
{
float64
(
SmallestNonzeroFloat64
),
"SmallestNonzero
Float64"
,
"5e-324"
},
{
float32
(
MaxFloat32
),
"MaxFloat32"
,
"3.4028235e+38"
},
{
float32
(
MinFloat32
),
"Min
Float32"
,
"1e-45"
},
{
float32
(
SmallestNonzeroFloat32
),
"SmallestNonzero
Float32"
,
"1e-45"
},
}
func
TestFloatMinMax
(
t
*
testing
.
T
)
{
...
...
src/pkg/math/const.go
View file @
9282a768
...
...
@@ -25,13 +25,13 @@ const (
// Floating-point limit values.
// Max is the largest finite value representable by the type.
//
Min is the smallest non
zero value representable by the type.
//
SmallestNonzero is the smallest positive, non-
zero value representable by the type.
const
(
MaxFloat32
=
3.40282346638528859811704183484516925440e+38
/* 2**127 * (2**24 - 1) / 2**23 */
Min
Float32
=
1.401298464324817070923729583289916131280e-45
/* 1 / 2**(127 - 1 + 23) */
MaxFloat32
=
3.40282346638528859811704183484516925440e+38
/* 2**127 * (2**24 - 1) / 2**23 */
SmallestNonzero
Float32
=
1.401298464324817070923729583289916131280e-45
/* 1 / 2**(127 - 1 + 23) */
MaxFloat64
=
1.797693134862315708145274237317043567981e+308
/* 2**1023 * (2**53 - 1) / 2**52 */
Min
Float64
=
4.940656458412465441765687928682213723651e-324
/* 1 / 2**(1023 - 1 + 52) */
MaxFloat64
=
1.797693134862315708145274237317043567981e+308
/* 2**1023 * (2**53 - 1) / 2**52 */
SmallestNonzero
Float64
=
4.940656458412465441765687928682213723651e-324
/* 1 / 2**(1023 - 1 + 52) */
)
// Integer limit values.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment