MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fx_Math_sign

Function fx_Math_sign

xs/sources/xsMath.c:658–673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

656}
657
658void fx_Math_sign(txMachine* the)
659{
660 txNumber arg;
661 mxNanResultIfNoArg;
662 arg = fxToNumber(the, mxArgv(0));
663 mxResult->kind = XS_NUMBER_KIND;
664 if (c_isnan(arg))
665 mxResult->value.number = C_NAN;
666 else if (arg < 0)
667 mxResult->value.number = -1;
668 else if (arg > 0)
669 mxResult->value.number = 1;
670 else
671 mxResult->value.number = arg;
672 fx_Math_toInteger(the);
673}
674
675void fx_Math_sin(txMachine* the)
676{

Callers

nothing calls this directly

Calls 2

fxToNumberFunction · 0.85
fx_Math_toIntegerFunction · 0.85

Tested by

no test coverage detected