feat: add Num.atan(x) method mapping to C atan2 for quadrant-aware arc tangent

Adds a new `atan(_)` primitive method to the Num class that wraps the C
`atan2` function, allowing callers to compute the arc tangent of the
number divided by a given argument `x` while using the signs of both
numbers to determine the correct quadrant of the result. The
implementation registers the primitive `num_atan2` in the core VM
initialization and documents the new method in the core library
reference.
This commit is contained in:
Thorbjørn Lindeijer
2015-03-15 15:43:02 +00:00
parent ac414a24fd
commit c717b8d3fd
2 changed files with 12 additions and 1 deletions
+5
View File
@@ -20,6 +20,11 @@ The arc sine of the number.
The arc tangent of the number.
### **atan**(x)
The arc tangent of the number when divided by `x`, using the signs of the two
numbers to determine the quadrant of the result.
### **ceil**
Rounds the number up to the nearest integer.