grain-lang / grain

The Grain compiler toolchain and CLI. Home of the modern web staple. 🌾
https://grain-lang.org/
GNU Lesser General Public License v3.0
3.25k stars 113 forks source link

Number stdlib Libary: Add following functions and values #1017

Open spotandjake opened 2 years ago

spotandjake commented 2 years ago

Add The Following Functions to the number Libary.

cician commented 2 years ago

I'd also add:

For logarithms it's useful to have three variants for most common bases: log2, log10 and log for the natural logarithm. Same for exp.

Trigonometric functions should definitely take radians and conversion functions would be nice.

spotandjake commented 1 year ago

1373 has been closed as the new plan is to use The range type I am linking it because it still contains some useful stuff related to documenting the map, clamp and lerp functions.