mirror of
https://github.com/janet-lang/janet
synced 2024-09-28 23:10:40 +00:00
math/nan
This commit is contained in:
parent
7fb8c4a68d
commit
a110b103e8
@ -499,5 +499,11 @@ void janet_lib_math(JanetTable *env) {
|
|||||||
JDOC("The number representing positive infinity"));
|
JDOC("The number representing positive infinity"));
|
||||||
janet_def(env, "math/-inf", janet_wrap_number(-INFINITY),
|
janet_def(env, "math/-inf", janet_wrap_number(-INFINITY),
|
||||||
JDOC("The number representing negative infinity"));
|
JDOC("The number representing negative infinity"));
|
||||||
|
#ifdef NAN
|
||||||
|
janet_def(env, "math/nan", janet_wrap_number(NAN),
|
||||||
|
#else
|
||||||
|
janet_def(env, "math/nan", janet_wrap_number(0.0/0.0),
|
||||||
|
#endif
|
||||||
|
JDOC("Not a number (IEEE-754 NaN)"));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user