1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-18 11:19:56 +00:00
This commit is contained in:
Jason Pepas 2020-07-01 15:35:36 -05:00
parent 7fb8c4a68d
commit a110b103e8

View File

@ -499,5 +499,11 @@ void janet_lib_math(JanetTable *env) {
JDOC("The number representing positive infinity"));
janet_def(env, "math/-inf", janet_wrap_number(-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
}