fix: replace DBL_EPSILON with DBL_MIN for Num.smallest in wren_core.c
Change the C implementation of `num_smallest` primitive to return `DBL_MIN` instead of `DBL_EPSILON`, correcting the value from the machine epsilon (difference between 1.0 and next representable value) to the smallest positive representable double. Update the documentation in `num.markdown` to describe `Num.smallest` as "the smallest positive representable numeric value" and `Num.largest` as "the largest representable numeric value". Add test files `largest.wren` and `smallest.wren` verifying the expected output values.
This commit is contained in:
+1
-1
@@ -691,7 +691,7 @@ DEF_PRIMITIVE(num_largest)
|
||||
|
||||
DEF_PRIMITIVE(num_smallest)
|
||||
{
|
||||
RETURN_NUM(DBL_EPSILON);
|
||||
RETURN_NUM(DBL_MIN);
|
||||
}
|
||||
|
||||
DEF_PRIMITIVE(num_toString)
|
||||
|
||||
Reference in New Issue
Block a user