CMathClass is a global singleton implementing the JavaScript Math object for XAP scripts. Exposes standard math functions (sin, cos, floor, etc.) and constants (PI, E, etc.). Backed by math_node.cpp in the active source tree.
Function names found in the binary string table:
abs,acos,asin,atan,atan2ceil,cos,exp,floor,logmax,min,pow,random,roundsin,sqrt,tan,itoa
CMathClass_absat0x00032af0CMathClass_floorat0x000223e4CMathClass_ceilat0x000223c4CMathClass_roundat0x00022418CMathClass_randomat0x00022410CMathClass_sqrtat0x00022434CMathClass_powat0x00022408CMathClass_atan2at0x000223b8
g_Math at 0x0001a508. Constructor populates JS Math constants. Not reference counted.
- All math wrappers are thin CRT calls (fabsf, sinf, cosf, etc.)
atan2(y, x)passes args reversed to match JS conventionitoaconverts int to Unicode string via CRT_itoa+Unicode()