Commit Graph

3 Commits

Author SHA1 Message Date
Jean Hadrien Chabran
01c87d1bf7 Handle integer conversion errors (#425)
When converting a double larger or equal to math.MaxInt64 to an integer, it previously overflowed silently. It now returns an explicit error.

This fixes along the way, the math.abs(-9223372036854775808) issue.
2021-07-25 18:25:02 +02:00
Jean Hadrien Chabran
1659ae24e5 Add more math functions (#421)
* Add math.acos and math.abs

* Add acosh, asin, asinh, atan and atan2

* Test for proper function documentation

* Cast to double on math functions

* Use the new types.Value interface
2021-07-22 15:47:56 +02:00
Jean Hadrien Chabran
e556fc3048 Add functions packages support (#419)
* Add packaged functions support

* Add tests for math.floor func

* Export FunctionsTable

* Extract func stuff into its own package

* Rename stuff

* Fix tests

* Move doc package to cmd/genji

* Adjust naming, typos
2021-07-17 13:07:16 +02:00