pocketlang/docs/Reference/math.md
Thakee Nathees 5bc9dcad6b method bind implemented
- MethodBind type added.
- Now methods are first class and can be passed around as arguments
  store as a variable and return it from a function and they're first
  class callbales.
- Can bind instance to a method bind using .bind() method
- Class.methods() method added -> return a list of all methods as
  method binds
- Module.globals() method added -> returns a list of all globals
  of that module.
- Var._class -> attribute added which will return the class of the
  variable
- Class.name, MethodBind.name, Closure.name attribute and Modue._name
  attribute added
- Class._docs, Closure._docs, MethodBind._docs attribute added
- MethodBind.instance attribute added
2022-06-06 02:47:31 +05:30

2.1 KiB

math

floor

math.floor(value:Numberber) -> Numberber

Return the floor value.

ceil

math.ceil(value:Number) -> Number

Returns the ceiling value.

pow

math.pow(a:Number, b:Number) -> Number

Returns the power 'b' of 'a' similler to a**b.

sqrt

math.sqrt(value:Number) -> Number

Returns the square root of the value

abs

math.abs(value:Number) -> Number

Returns the absolute value.

sign

math.sign(value:Number) -> Number

return the sign of the which is one of (+1, 0, -1).

sin

math.sin(rad:Number) -> Number

Return the sine value of the argument [rad] which is an angle expressed in radians.

cos

math.cos(rad:Number) -> Number

Return the cosine value of the argument [rad] which is an angle expressed in radians.

tan

math.tan(rad:Number) -> Number

Return the tangent value of the argument [rad] which is an angle expressed in radians.

sinh

math.sinh(val:Number) -> Number

Return the hyperbolic sine value of the argument [val].

cosh

math.cosh(val:Number) -> Number

Return the hyperbolic cosine value of the argument [val].

tanh

math.tanh(val:Number) -> Number

Return the hyperbolic tangent value of the argument [val].

asin

math.asin(num:Number) -> Number

Return the arcsine value of the argument [num] which is an angle expressed in radians.

acos

math.acos(num:Number) -> Number

Return the arc cosine value of the argument [num] which is an angle expressed in radians.

atan

math.atan(num:Number) -> Number

Return the arc tangent value of the argument [num] which is an angle expressed in radians.

log10

math.log10(value:Number) -> Number

Return the logarithm to base 10 of argument [value]

round

math.round(value:Number) -> Number

Round to nearest integer, away from zero and return the number.

rand

math.rand() -> Number

Return a random runber in the range of 0..0x7fff.