Added Num.tan
Strange omission with Num.sin and Num.cos already available.
This commit is contained in:
parent
92c17e81f6
commit
09bcf5ad98
@ -42,6 +42,10 @@ The sine of the number.
|
|||||||
|
|
||||||
The square root of the number. Returns `nan` if the number is negative.
|
The square root of the number. Returns `nan` if the number is negative.
|
||||||
|
|
||||||
|
### **tan**
|
||||||
|
|
||||||
|
The tangent of the number.
|
||||||
|
|
||||||
### **-** operator
|
### **-** operator
|
||||||
|
|
||||||
Negates the number.
|
Negates the number.
|
||||||
|
|||||||
@ -962,6 +962,11 @@ DEF_PRIMITIVE(num_sqrt)
|
|||||||
RETURN_NUM(sqrt(AS_NUM(args[0])));
|
RETURN_NUM(sqrt(AS_NUM(args[0])));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEF_PRIMITIVE(num_tan)
|
||||||
|
{
|
||||||
|
RETURN_NUM(tan(AS_NUM(args[0])));
|
||||||
|
}
|
||||||
|
|
||||||
DEF_PRIMITIVE(num_toString)
|
DEF_PRIMITIVE(num_toString)
|
||||||
{
|
{
|
||||||
double value = AS_NUM(args[0]);
|
double value = AS_NUM(args[0]);
|
||||||
@ -1594,6 +1599,7 @@ void wrenInitializeCore(WrenVM* vm)
|
|||||||
PRIMITIVE(vm->numClass, "sign", num_sign);
|
PRIMITIVE(vm->numClass, "sign", num_sign);
|
||||||
PRIMITIVE(vm->numClass, "sin", num_sin);
|
PRIMITIVE(vm->numClass, "sin", num_sin);
|
||||||
PRIMITIVE(vm->numClass, "sqrt", num_sqrt);
|
PRIMITIVE(vm->numClass, "sqrt", num_sqrt);
|
||||||
|
PRIMITIVE(vm->numClass, "tan", num_tan);
|
||||||
PRIMITIVE(vm->numClass, "toString", num_toString);
|
PRIMITIVE(vm->numClass, "toString", num_toString);
|
||||||
PRIMITIVE(vm->numClass, "truncate", num_truncate);
|
PRIMITIVE(vm->numClass, "truncate", num_truncate);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user