1
0
forked from Mirror/wren

Use DBL_MIN instead of DBL_EPSILON for Num.smallest.

This commit is contained in:
Bob Nystrom
2016-08-27 17:25:32 -07:00
parent b8b0f36521
commit 09ef904d32
4 changed files with 5 additions and 3 deletions

View File

@ -15,11 +15,11 @@ The value of π.
### Num.**largest**
The highest representable value of `Num`.
The largest representable numeric value.
### Num.**smallest**
The difference between 1.0 and the next representable value for `Num`.
The smallest positive representable numeric value.
## Methods

View File

@ -691,7 +691,7 @@ DEF_PRIMITIVE(num_largest)
DEF_PRIMITIVE(num_smallest)
{
RETURN_NUM(DBL_EPSILON);
RETURN_NUM(DBL_MIN);
}
DEF_PRIMITIVE(num_toString)

View File

@ -0,0 +1 @@
System.print(Num.largest) // expect: 1.7976931348623e+308

View File

@ -0,0 +1 @@
System.print(Num.smallest) // expect: 2.2250738585072e-308