@@ -271,28 +271,30 @@ JANET_DEFINE_MATHOP(cosh, "Returns the hyperbolic cosine of x.")
271271JANET_DEFINE_MATHOP (acosh , "Returns the hyperbolic arccosine of x." )
272272JANET_DEFINE_MATHOP (sin , "Returns the sine of x." )
273273JANET_DEFINE_MATHOP (sinh , "Returns the hyperbolic sine of x." )
274- JANET_DEFINE_MATHOP (asinh , "Returns the hyperbolic arcsine of x." )
275274JANET_DEFINE_MATHOP (tan , "Returns the tangent of x." )
276275JANET_DEFINE_MATHOP (tanh , "Returns the hyperbolic tangent of x." )
277- JANET_DEFINE_MATHOP (atanh , "Returns the hyperbolic arctangent of x." )
278276JANET_DEFINE_MATHOP (exp , "Returns e to the power of x." )
279277JANET_DEFINE_MATHOP (exp2 , "Returns 2 to the power of x." )
278+ JANET_DEFINE_MATHOP (log1p , "Returns (log base e of x) + 1 more accurately than (+ (math/log x) 1)" )
279+ #ifndef JANET_PLAN9
280280JANET_DEFINE_MATHOP (expm1 , "Returns e to the power of x minus 1." )
281+ JANET_DEFINE_MATHOP (cbrt , "Returns the cube root of x." )
282+ JANET_DEFINE_MATHOP (erf , "Returns the error function of x." )
283+ JANET_DEFINE_MATHOP (erfc , "Returns the complementary error function of x." )
284+ JANET_DEFINE_NAMED_MATHOP ("log-gamma" , lgamma , "Returns log-gamma(x)." )
285+ JANET_DEFINE_NAMED_MATHOP ("gamma" , tgamma , "Returns gamma(x)." )
286+ JANET_DEFINE_MATHOP (atanh , "Returns the hyperbolic arctangent of x." )
287+ JANET_DEFINE_MATHOP (asinh , "Returns the hyperbolic arcsine of x." )
288+ #endif
281289JANET_DEFINE_MATHOP (log , "Returns the natural logarithm of x." )
282290JANET_DEFINE_MATHOP (log10 , "Returns the log base 10 of x." )
283291JANET_DEFINE_MATHOP (log2 , "Returns the log base 2 of x." )
284292JANET_DEFINE_MATHOP (sqrt , "Returns the square root of x." )
285- JANET_DEFINE_MATHOP (cbrt , "Returns the cube root of x." )
286293JANET_DEFINE_MATHOP (ceil , "Returns the smallest integer value number that is not less than x." )
287294JANET_DEFINE_MATHOP (floor , "Returns the largest integer value number that is not greater than x." )
288295JANET_DEFINE_MATHOP (trunc , "Returns the integer between x and 0 nearest to x." )
289296JANET_DEFINE_MATHOP (round , "Returns the integer nearest to x." )
290- JANET_DEFINE_MATHOP (log1p , "Returns (log base e of x) + 1 more accurately than (+ (math/log x) 1)" )
291- JANET_DEFINE_MATHOP (erf , "Returns the error function of x." )
292- JANET_DEFINE_MATHOP (erfc , "Returns the complementary error function of x." )
293- JANET_DEFINE_NAMED_MATHOP ("log-gamma" , lgamma , "Returns log-gamma(x)." )
294297JANET_DEFINE_NAMED_MATHOP ("abs" , fabs , "Return the absolute value of x." )
295- JANET_DEFINE_NAMED_MATHOP ("gamma" , tgamma , "Returns gamma(x)." )
296298
297299#define JANET_DEFINE_MATH2OP (name , fop , signature , doc )\
298300JANET_CORE_FN(janet_##name, signature, doc) {\
@@ -305,7 +307,9 @@ JANET_CORE_FN(janet_##name, signature, doc) {\
305307JANET_DEFINE_MATH2OP (atan2 , atan2 , "(math/atan2 y x)" , "Returns the arctangent of y/x. Works even when x is 0." )
306308JANET_DEFINE_MATH2OP (pow , pow , "(math/pow a x)" , "Returns a to the power of x." )
307309JANET_DEFINE_MATH2OP (hypot , hypot , "(math/hypot a b)" , "Returns c from the equation c^2 = a^2 + b^2." )
310+ #ifndef JANET_PLAN9
308311JANET_DEFINE_MATH2OP (nextafter , nextafter , "(math/next x y)" , "Returns the next representable floating point value after x in the direction of y." )
312+ #endif
309313
310314JANET_CORE_FN (janet_not , "(not x)" , "Returns the boolean inverse of x." ) {
311315 janet_fixarity (argc , 1 );
@@ -386,16 +390,24 @@ void janet_lib_math(JanetTable *env) {
386390 JANET_CORE_REG ("math/log10" , janet_log10 ),
387391 JANET_CORE_REG ("math/log2" , janet_log2 ),
388392 JANET_CORE_REG ("math/sqrt" , janet_sqrt ),
393+ #ifndef JANET_PLAN9
389394 JANET_CORE_REG ("math/cbrt" , janet_cbrt ),
395+ JANET_CORE_REG ("math/gamma" , janet_tgamma ),
396+ JANET_CORE_REG ("math/log-gamma" , janet_lgamma ),
397+ JANET_CORE_REG ("math/erfc" , janet_erfc ),
398+ JANET_CORE_REG ("math/erf" , janet_erf ),
399+ JANET_CORE_REG ("math/expm1" , janet_expm1 ),
400+ JANET_CORE_REG ("math/atanh" , janet_atanh ),
401+ JANET_CORE_REG ("math/asinh" , janet_asinh ),
402+ JANET_CORE_REG ("math/next" , janet_nextafter ),
403+ #endif
390404 JANET_CORE_REG ("math/floor" , janet_floor ),
391405 JANET_CORE_REG ("math/ceil" , janet_ceil ),
392406 JANET_CORE_REG ("math/pow" , janet_pow ),
393407 JANET_CORE_REG ("math/abs" , janet_fabs ),
394408 JANET_CORE_REG ("math/sinh" , janet_sinh ),
395409 JANET_CORE_REG ("math/cosh" , janet_cosh ),
396410 JANET_CORE_REG ("math/tanh" , janet_tanh ),
397- JANET_CORE_REG ("math/atanh" , janet_atanh ),
398- JANET_CORE_REG ("math/asinh" , janet_asinh ),
399411 JANET_CORE_REG ("math/acosh" , janet_acosh ),
400412 JANET_CORE_REG ("math/atan2" , janet_atan2 ),
401413 JANET_CORE_REG ("math/rng" , cfun_rng_make ),
@@ -405,14 +417,8 @@ void janet_lib_math(JanetTable *env) {
405417 JANET_CORE_REG ("math/hypot" , janet_hypot ),
406418 JANET_CORE_REG ("math/exp2" , janet_exp2 ),
407419 JANET_CORE_REG ("math/log1p" , janet_log1p ),
408- JANET_CORE_REG ("math/gamma" , janet_tgamma ),
409- JANET_CORE_REG ("math/log-gamma" , janet_lgamma ),
410- JANET_CORE_REG ("math/erfc" , janet_erfc ),
411- JANET_CORE_REG ("math/erf" , janet_erf ),
412- JANET_CORE_REG ("math/expm1" , janet_expm1 ),
413420 JANET_CORE_REG ("math/trunc" , janet_trunc ),
414421 JANET_CORE_REG ("math/round" , janet_round ),
415- JANET_CORE_REG ("math/next" , janet_nextafter ),
416422 JANET_CORE_REG ("math/gcd" , janet_cfun_gcd ),
417423 JANET_CORE_REG ("math/lcm" , janet_cfun_lcm ),
418424 JANET_CORE_REG ("math/frexp" , janet_cfun_frexp ),
0 commit comments