-
Notifications
You must be signed in to change notification settings - Fork 3
Arithmetic built in functions
Qliphoth provides built-in functions for various arithmetic processing.
Calculate the value of first argument to the power of the value of second argument.
-
double: Base valuex. -
double: Power valuey.
double: Power value x^y; which ^ means exponentiation operation here.
x = 2
y = 10
ret = pow(2, 10)
println "x^y = ", ret // 1024 will be output
Calculate sine value of argument.
double: Radian value x.
double: Sine value of x.
x = 0.5
ret = sin(x)
println "sin(x)=", ret
Calculate cosine value of argument.
double: Radian value x.
double: Cosine value of x.
x = 0.5
ret = cos(x)
println "cos(x)=", ret
Calculate tangent value of argument.
double: Radian value x.
double: Tangent value of x.
x = 0.5
ret = tan(x)
println "tan(x)=", ret
Calculate natural logarithm of argument.
double: Antilogarithm x.
double: Natural logarithm of x.
x = 10
ret = log(x)
println "log_e(x)=", ret
Calculate base-10 logarithm of argument.
double: Antilogarithm x.
double: Base-10 logarithm of x.
x = 10
ret = log10(x)
println "log_10(x)=", ret
Calculate the power, whose base is Napier's constant and exponent is passed argument.
double: Exponent x.
double: Power value e^x, where e means Napier's constant.
x = 10
ret = exp(x)
println "exp(x)=", ret
Calculate square root of argument.
double: The value x to get square root.
double: square root of x.
x = 100
ret = sqrt(x)
println "sqrt(x)=", ret
Calculate cube root of argument.
double: The value x to get cube root.
double: cube root of x.
x = 1000
ret = cbrt(x)
println "cbrt(x)=", ret
Calculate absolute value of argument.
double: The value x to get absolute value.
double: Absolute value |x|.
x = -10
ret = absl(x)
println "absl(x)=", ret
Calculate result of ceiling function for passed argument.
double: The value x to pass to ceiling function.
double: The result of ceiling function x.
x = 10.5
ret = ceil(x)
println "ceil(x)=", ret // 10 will be output
Calculate result of floor function for passed argument. Currently, the effect and the output of this function is completely equal to toint. Probably toint will be deprecated in the future.
double: The value x to pass to floor function.
double: The result of floor function x.
x = 10.5
ret = floor(x)
println "floor(x)=", ret // 11 will be output
Round double value to integer.
double: The value x to round.
double: Rounded value of x.
a = 10.1
b = 10.9
ret1 = round(x)
ret2 = round(y)
println "round(a)=", ret1 // 10 will be output
println "round(b)=", ret2 // 11 will be output