WIP wren/core: Add DEF_NUM_CONSTANT (with Num::infinity and Num::nan). (#781)

* wren/vm: Add "wren_math.h".
* wren/core: Add DEF_NUM_CONSTANT.
* wren/core: Add `Num::infinity` constant.
* wren/core: Add `Num::nan` constant.
This commit is contained in:
Michel Hermier
2020-12-03 20:37:53 +01:00
committed by GitHub
parent 59ee326523
commit a11d66cbd3
5 changed files with 64 additions and 31 deletions

View File

@ -9,6 +9,16 @@ Attempts to parse `value` as a decimal literal and return it as an instance of
It is a runtime error if `value` is not a string.
### Num.**infinity**
The value of &infinity;.
### Num.**nan**
One value representing a NaN.
Provides a default sane NaN number suitable for the vm internal values.
### Num.**pi**
The value of π.