As for how I'd implement the rest of Lua's `math` standard library upon our Lua interpreter bootstrapped upon a risc32cfimv...
`math.abs` could simply be `if x < 0 do return -x else return x end`.
`math.ceil`, `math.floor`, `math.fmod`, & `math.sqrt` have corresponding opcodes from the RISC-V "F" extension, mainly thanks to its rounding-mode flags. And as such would be implemented in Assembly.
`math.deg` & `math.rad` multiplies or divides its argument by pi/180 unit-conversion factor.
1/3?