Members
(constant) NV_MAGICCONST :Number
Also known as global.nv_magicconst. Used in normal variate random distribution.
Type:
-
Number
(constant) SMALL_FACTORIALS :Number
Also known as global.small_factorials. Lookup table for int64 factorial values.
Type:
-
Number
(constant) TWOPI :Number
Also known as global.tau
Type:
-
Number
Methods
_add(a, b) → {Number}
Add values of two arguments
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
|
b |
Number
|
Returns:
- Type:
-
Number
a + b
Example
_add( 2, 2 ) --> 4
_add( "foo", "bar" ) --> "foobar:
_div(a, b) → {Number}
Divides first argment by the secone one
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
|
b |
Number
|
Returns:
- Type:
-
Number
a / b
Example
_div( 4, 2 ) --> 2
_eq(a, b) → {Bool}
Returns true if two arguments are equal
Parameters:
Name | Type | Description |
---|---|---|
a |
Any
|
|
b |
Any
|
Returns:
- Type:
-
Bool
_floordiv(a, b) → {Number}
Divides first argment by the secone one and returns integer part.
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
|
b |
Number
|
Returns:
- Type:
-
Number
a div b
Example
_div( 5, 2 ) --> 2.50
_floordiv( 5, 2 ) --> 2
_identity(a) → {Any}
Function that returns it's argument
Parameters:
Name | Type | Description |
---|---|---|
a |
Any
|
Returns:
- Type:
-
Any
a
Example
_identity( 10 ) --> 10
_list()
returns ds_list
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
... |
<optional> |
_map()
returns ds_map
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
... |
array
|
<optional> |
key, value pairs |
_max(_a, _b) → {Number}
Returns largest of the input values
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
_a |
Number
|
||
_b |
Number
|
||
... |
Number
|
<optional> |
Returns:
- Type:
-
Number
Largest of the input values
Example
_max( 1, 2, 3 ) --> 3
_min(_a, _b) → {Number}
Returns smallest of the input values
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
_a |
Number
|
||
_b |
Number
|
||
... |
Number
|
<optional> |
Returns:
- Type:
-
Number
Smallest of the input values
Example
_min( 1, 2, 3 ) --> 1
_mod(a, b) → {Number}
Divides first argment by the secone one and returns modulus.
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
|
b |
Number
|
Returns:
- Type:
-
Number
modulus of a divided by b
Example
_mod( 4, 2 ) --> 0
_mul(a, b) → {Number}
Multiplies argument values
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
|
b |
Number
|
Returns:
- Type:
-
Number
a * b
Example
_mul( 2, 2 ) --> 4
_pow(a, b) → {Number}
Substract second argument from the first one
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
|
b |
Number
|
Returns:
- Type:
-
Number
power( a, b )
Example
_pow( 2, 2 ) --> 4
_priority()
returns ds_priority
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
... |
array
|
<optional> |
value, priority pairs |
_queue()
returns ds_queue
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
... |
<optional> |
_rem(a, b) → {Number}
Divides first argment by the secone one and returns remainder.
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
|
b |
Number
|
Returns:
- Type:
-
Number
a % b
Example
_rem( 4, 2 ) --> 0
_stack()
returns ds_stack
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
... |
<optional> |
_sub(a, b) → {Number}
Substract second argument from the first one
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
|
b |
Number
|
Returns:
- Type:
-
Number
a - b
Example
_sub( 4, 2 ) --> 2
_truth(a) → {Bool}
Returns if argument is true
Parameters:
Name | Type | Description |
---|---|---|
a |
Any
|
Returns:
- Type:
-
Bool
Boolean representation of object
Example
_truth( 1 ) --> true
_truth( 0.2 ) --> false
apply(function, arguments) → {Any}
Executes function with arguments passed as array. Up to 16 arguments supported.
Parameters:
Name | Type | Description |
---|---|---|
function |
Method
|
|
arguments |
Array
|
Returns:
- Type:
-
Any
Result returned by function
Example
apply( min, [ 1, 2, 3 ] ) --> 1
assert(condidion, message)
Asserts that a condition is true. If it isn't it throws an error with the given message.
Parameters:
Name | Type | Description |
---|---|---|
condidion |
Bool
|
|
message |
String
|
assert_array_equals(expected, actuals, messageopt)
Asserts that two arguments are equal. If they are not, an error is thrown with the given message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expected |
Array
|
||
actuals |
Array
|
||
message |
String
|
<optional> |
assert_equals(expected, actuals, messageopt)
Asserts that two arguments are equal. If they are not, an error is thrown with the given message.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expected |
Any
|
||
actuals |
Any
|
||
message |
String
|
<optional> |
bit_length(a) → {Number}
Returns number of bits that are needed to represent a.
Parameters:
Name | Type | Description |
---|---|---|
a |
Number
|
Returns:
- Type:
-
Number
Example
bit_length( -37 ) --> 6 // -37 = -0b100101
factorial(x) → {Number}
Return x factorial as an integer.
Parameters:
Name | Type | Description |
---|---|---|
x |
Number
|
Returns:
- Type:
-
Number
is_between(value, a, b) → {Bool}
Check if value is in range [ a, b ]
Parameters:
Name | Type | Description |
---|---|---|
value |
Number
|
|
a |
Number
|
|
b |
Number
|
Returns:
- Type:
-
Bool
isqrt(n) → {Number}
Return the integer part of the square root of n.
Parameters:
Name | Type | Description |
---|---|---|
n |
Number
|
Returns:
- Type:
-
Number
Example
isqrt( 6 ) --> 2
log()
Concatenates all arguments and outputs to console using show_debug_message
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
... |
Any
|
<optional> |