forked from Mirror/wren
Use DBL_MIN instead of DBL_EPSILON for Num.smallest.
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
@ -691,7 +691,7 @@ DEF_PRIMITIVE(num_largest)
|
||||
|
||||
DEF_PRIMITIVE(num_smallest)
|
||||
{
|
||||
RETURN_NUM(DBL_EPSILON);
|
||||
RETURN_NUM(DBL_MIN);
|
||||
}
|
||||
|
||||
DEF_PRIMITIVE(num_toString)
|
||||
|
||||
1
test/core/number/largest.wren
Normal file
1
test/core/number/largest.wren
Normal file
@ -0,0 +1 @@
|
||||
System.print(Num.largest) // expect: 1.7976931348623e+308
|
||||
1
test/core/number/smallest.wren
Normal file
1
test/core/number/smallest.wren
Normal file
@ -0,0 +1 @@
|
||||
System.print(Num.smallest) // expect: 2.2250738585072e-308
|
||||
Reference in New Issue
Block a user