Use DBL_MIN instead of DBL_EPSILON for Num.smallest.
This commit is contained in:
@@ -15,11 +15,11 @@ The value of π.
|
|||||||
|
|
||||||
### Num.**largest**
|
### Num.**largest**
|
||||||
|
|
||||||
The highest representable value of `Num`.
|
The largest representable numeric value.
|
||||||
|
|
||||||
### Num.**smallest**
|
### Num.**smallest**
|
||||||
|
|
||||||
The difference between 1.0 and the next representable value for `Num`.
|
The smallest positive representable numeric value.
|
||||||
|
|
||||||
## Methods
|
## Methods
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -691,7 +691,7 @@ DEF_PRIMITIVE(num_largest)
|
|||||||
|
|
||||||
DEF_PRIMITIVE(num_smallest)
|
DEF_PRIMITIVE(num_smallest)
|
||||||
{
|
{
|
||||||
RETURN_NUM(DBL_EPSILON);
|
RETURN_NUM(DBL_MIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEF_PRIMITIVE(num_toString)
|
DEF_PRIMITIVE(num_toString)
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
System.print(Num.largest) // expect: 1.7976931348623e+308
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
System.print(Num.smallest) // expect: 2.2250738585072e-308
|
||||||
Reference in New Issue
Block a user