Lua's math library in TypeScript


We have 16 Lua functions so far - help us add more

Got a rainy Sunday afternoon and a taste for a porting puzzle?

  • Get inspiration from the Lua 5.4 manual.
  • Click "New file" in the appropriate folder on GitHub. This will fork the project to your account, directly add the file to it, and send a Pull Request to us.

We will then review it. If it's useful to the project and in line with our contributing guidelines your work will become part of Locutus and you'll be automatically credited in the authors section accordingly.

Upstream Surface Inventory 9/31 shipped • 21 next 29%

Namespace-level inventory for Lua 5.4: what we already ship, what we may still want, and what we intentionally skip or keep.

math

Lua 5.4 · Catalog source: live runtime snapshot nickblah/lua:5.4-alpine:math

30% shipped
9/30 shipped 21 next 1 explicit non-goals
Shipped (9)

Next

Lua math helpers map cleanly to JS numbers.

  • acos
  • asin
  • atan
  • atan2
  • cosh
  • deg
  • exp
  • fmod
  • frexp
  • ldexp
  • log
  • log10
  • modf
  • pow
  • rad
  • random
  • sinh
  • tan
  • tanh
  • tointeger
  • ult
Explicit non-goals (1)
  • randomseed Skip Global RNG seeding mutates ambient runtime state.

« More Lua functions