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

Function fx_Math_clz32

xs/sources/xsMath.c:211–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209}
210
211void fx_Math_clz32(txMachine* the)
212{
213 txUnsigned x = (mxArgc > 0) ? fxToUnsigned(the, mxArgv(0)) : 0;
214 txInteger r;
215 if (x)
216#if mxWindows
217 {
218 _BitScanReverse(&r, x);
219 r = 31 - r;
220 }
221#else
222 r = __builtin_clz(x);
223#endif
224 else
225 r = 32;
226 mxResult->kind = XS_INTEGER_KIND;
227 mxResult->value.integer = r;
228}
229
230void fx_Math_cos(txMachine* the)
231{

Callers

nothing calls this directly

Calls 1

fxToUnsignedFunction · 0.85

Tested by

no test coverage detected