MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / DefineEngineFunction

Function DefineEngineFunction

Engine/source/math/mConsoleFunctions.cpp:446–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

444}
445
446DefineEngineFunction(mDecToBin, const char*, (S32 n), , "convert decimal to a binary")
447{
448 String ret;
449 while (n > 0) {
450 int r = n % 2;//modulus aka remainder of 2. nets you a 0 or a 1
451 n /= 2;//next power of 2
452 ret = String::ToString("%i",r) + ret;//add to the front of the stack
453 }
454 return ret.c_str();
455}

Callers 1

Calls 1

c_strMethod · 0.45

Tested by

no test coverage detected