pocketlang/docs/Reference/math.md

146 lines
2.1 KiB
Markdown
Raw Permalink Normal View History

# 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.