mirror of
https://github.com/zekexiao/pocketlang.git
synced 2025-03-04 13:15:55 +08:00

- 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
146 lines
2.1 KiB
Markdown
146 lines
2.1 KiB
Markdown
# math
|
|
|
|
### floor
|
|
|
|
```ruby
|
|
math.floor(value:Numberber) -> Numberber
|
|
```
|
|
|
|
Return the floor value.
|
|
|
|
### ceil
|
|
|
|
```ruby
|
|
math.ceil(value:Number) -> Number
|
|
```
|
|
|
|
Returns the ceiling value.
|
|
|
|
### pow
|
|
|
|
```ruby
|
|
math.pow(a:Number, b:Number) -> Number
|
|
```
|
|
|
|
Returns the power 'b' of 'a' similler to a**b.
|
|
|
|
### sqrt
|
|
|
|
```ruby
|
|
math.sqrt(value:Number) -> Number
|
|
```
|
|
|
|
Returns the square root of the value
|
|
|
|
### abs
|
|
|
|
```ruby
|
|
math.abs(value:Number) -> Number
|
|
```
|
|
|
|
Returns the absolute value.
|
|
|
|
### sign
|
|
|
|
```ruby
|
|
math.sign(value:Number) -> Number
|
|
```
|
|
|
|
return the sign of the which is one of (+1, 0, -1).
|
|
|
|
### sin
|
|
|
|
```ruby
|
|
math.sin(rad:Number) -> Number
|
|
```
|
|
|
|
Return the sine value of the argument [rad] which is an angle expressed in radians.
|
|
|
|
### cos
|
|
|
|
```ruby
|
|
math.cos(rad:Number) -> Number
|
|
```
|
|
|
|
Return the cosine value of the argument [rad] which is an angle expressed in radians.
|
|
|
|
### tan
|
|
|
|
```ruby
|
|
math.tan(rad:Number) -> Number
|
|
```
|
|
|
|
Return the tangent value of the argument [rad] which is an angle expressed in radians.
|
|
|
|
### sinh
|
|
|
|
```ruby
|
|
math.sinh(val:Number) -> Number
|
|
```
|
|
|
|
Return the hyperbolic sine value of the argument [val].
|
|
|
|
### cosh
|
|
|
|
```ruby
|
|
math.cosh(val:Number) -> Number
|
|
```
|
|
|
|
Return the hyperbolic cosine value of the argument [val].
|
|
|
|
### tanh
|
|
|
|
```ruby
|
|
math.tanh(val:Number) -> Number
|
|
```
|
|
|
|
Return the hyperbolic tangent value of the argument [val].
|
|
|
|
### asin
|
|
|
|
```ruby
|
|
math.asin(num:Number) -> Number
|
|
```
|
|
|
|
Return the arcsine value of the argument [num] which is an angle expressed in radians.
|
|
|
|
### acos
|
|
|
|
```ruby
|
|
math.acos(num:Number) -> Number
|
|
```
|
|
|
|
Return the arc cosine value of the argument [num] which is an angle expressed in radians.
|
|
|
|
### atan
|
|
|
|
```ruby
|
|
math.atan(num:Number) -> Number
|
|
```
|
|
|
|
Return the arc tangent value of the argument [num] which is an angle expressed in radians.
|
|
|
|
### log10
|
|
|
|
```ruby
|
|
math.log10(value:Number) -> Number
|
|
```
|
|
|
|
Return the logarithm to base 10 of argument [value]
|
|
|
|
### round
|
|
|
|
```ruby
|
|
math.round(value:Number) -> Number
|
|
```
|
|
|
|
Round to nearest integer, away from zero and return the number.
|
|
|
|
### rand
|
|
|
|
```ruby
|
|
math.rand() -> Number
|
|
```
|
|
|
|
Return a random runber in the range of 0..0x7fff.
|