Added more goniometry Num methods
Num.acos Num.asin Num.atan
This commit is contained in:
parent
09bcf5ad98
commit
42dd7cdad4
@ -8,6 +8,18 @@ The absolute value of the number.
|
|||||||
:::dart
|
:::dart
|
||||||
-123.abs // 123
|
-123.abs // 123
|
||||||
|
|
||||||
|
### **acos**
|
||||||
|
|
||||||
|
The arc cosine of the number.
|
||||||
|
|
||||||
|
### **asin**
|
||||||
|
|
||||||
|
The arc sine of the number.
|
||||||
|
|
||||||
|
### **atan**
|
||||||
|
|
||||||
|
The arc tangent of the number.
|
||||||
|
|
||||||
### **ceil**
|
### **ceil**
|
||||||
|
|
||||||
Rounds the number up to the nearest integer.
|
Rounds the number up to the nearest integer.
|
||||||
|
|||||||
@ -909,6 +909,21 @@ DEF_PRIMITIVE(num_abs)
|
|||||||
RETURN_NUM(fabs(AS_NUM(args[0])));
|
RETURN_NUM(fabs(AS_NUM(args[0])));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEF_PRIMITIVE(num_acos)
|
||||||
|
{
|
||||||
|
RETURN_NUM(acos(AS_NUM(args[0])));
|
||||||
|
}
|
||||||
|
|
||||||
|
DEF_PRIMITIVE(num_asin)
|
||||||
|
{
|
||||||
|
RETURN_NUM(asin(AS_NUM(args[0])));
|
||||||
|
}
|
||||||
|
|
||||||
|
DEF_PRIMITIVE(num_atan)
|
||||||
|
{
|
||||||
|
RETURN_NUM(atan(AS_NUM(args[0])));
|
||||||
|
}
|
||||||
|
|
||||||
DEF_PRIMITIVE(num_ceil)
|
DEF_PRIMITIVE(num_ceil)
|
||||||
{
|
{
|
||||||
RETURN_NUM(ceil(AS_NUM(args[0])));
|
RETURN_NUM(ceil(AS_NUM(args[0])));
|
||||||
@ -1591,6 +1606,9 @@ void wrenInitializeCore(WrenVM* vm)
|
|||||||
PRIMITIVE(vm->numClass, "..(_)", num_dotDot);
|
PRIMITIVE(vm->numClass, "..(_)", num_dotDot);
|
||||||
PRIMITIVE(vm->numClass, "...(_)", num_dotDotDot);
|
PRIMITIVE(vm->numClass, "...(_)", num_dotDotDot);
|
||||||
PRIMITIVE(vm->numClass, "abs", num_abs);
|
PRIMITIVE(vm->numClass, "abs", num_abs);
|
||||||
|
PRIMITIVE(vm->numClass, "acos", num_acos);
|
||||||
|
PRIMITIVE(vm->numClass, "asin", num_asin);
|
||||||
|
PRIMITIVE(vm->numClass, "atan", num_atan);
|
||||||
PRIMITIVE(vm->numClass, "ceil", num_ceil);
|
PRIMITIVE(vm->numClass, "ceil", num_ceil);
|
||||||
PRIMITIVE(vm->numClass, "cos", num_cos);
|
PRIMITIVE(vm->numClass, "cos", num_cos);
|
||||||
PRIMITIVE(vm->numClass, "floor", num_floor);
|
PRIMITIVE(vm->numClass, "floor", num_floor);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user