benilla-re systems structs docs

math_sin

function · lua · boundary

Address
0x7fae10 · 35 bytes, up to 0x7fae32
Signature
int __fastcall (lua_State *L)
Meaning
Pushes the sine of an angle in radians
Confidence
verified, proof one
Finding
lua/libs#math-functions

Finding: Math functions in lua: the libraries

Twelve functions of the math library wrap one operation each: abs (fabs), sin, cos and tan (fsin, fcos, fptan, in radians), atan and atan2 (fpatan), asin and acos (the C runtime), floor, mod (fmod), sqrt (fsqrt) and pow. Each reads its arguments with luaL_checknumber, pushes one number and answers 1. Nothing bounds the angle: a finite operand of magnitude 2^63 or more is outside the x87's range, so math.sin(x) and math.cos(x) answer x itself and math.tan(x) answers the x87's indefinite NaN, which tostring prints -1.#IND. ±∞ is an invalid operand, and all three answer the indefinite.

functionnamedecided by
0x7fade0math_absfabs (0x7faded)
0x7fae10math_sinfsin (0x7fae1d)
0x7fae40math_cosfcos (0x7fae4d)
0x7fae70math_tanfptan (0x7fae7d), the extra 1.0 popped (0x7fae84)
0x7faea0math_asinthe C runtime routine (0x7faead)
0x7faed0math_acosthe C runtime routine (0x7faedd)
0x7faf00math_atanfld1; fpatan (0x7faf0d, 0x7faf0f)
0x7faf30math_atan2two arguments, fpatan (0x7faf5a)
0x7fafa0math_floorC runtime floor (0x7fafb3)
0x7fafd0math_modC runtime fmod (0x7faff7)
0x7fb020math_sqrtfsqrt (0x7fb02d)
0x7fb050math_powC runtime pow (0x7fb077)

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 2

Calls and jumps by a bare address, from tables/calls.tsv.