- Mathematical :
object
Mathematical is a collection of methods to help dealing with the Number class in javascript
- decimalsCurry(func) ⇒
function
A method factory to deal with decimals
Mathematical is a collection of methods to help dealing with the Number class in javascript
Kind: global namespace
this: HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
arrayLike | object |
A NodeList, HTMLCollection or an Array Like object containing HTMLElements or undefined properties |
- Mathematical :
object
- .Utils :
object
- .round(num, [decimals]) ⇒
Number
- .ceil(num, [decimals]) ⇒
Number
- .floor(num, [decimals]) ⇒
Number
- .roundToEven(num, [decimals]) ⇒
Number
- .random([min], [max]) ⇒
Number
- .randomInt([min], [max]) ⇒
Number
- .getDirection(num) ⇒
Number
- .round(num, [decimals]) ⇒
- .Utils :
Utilities to deal with numbers
Kind: static namespace of Mathematical
this: HTMLStock
Access: public
Since: 0.1.0
Param | Type | Description |
---|---|---|
arrayLike | object |
A NodeList, HTMLCollection or an Array Like object containing HTMLElements or undefined properties |
- .Utils :
object
- .round(num, [decimals]) ⇒
Number
- .ceil(num, [decimals]) ⇒
Number
- .floor(num, [decimals]) ⇒
Number
- .roundToEven(num, [decimals]) ⇒
Number
- .random([min], [max]) ⇒
Number
- .randomInt([min], [max]) ⇒
Number
- .getDirection(num) ⇒
Number
- .round(num, [decimals]) ⇒
A proxy to Math.round method, but with scientific notation to deal with decimals
Kind: static method of Utils
Access: public
Since: 1.0.0
Param | Type | Description |
---|---|---|
num | number |
The number to be rounded |
[decimals] | number |
The number of decimals that will be used |
A proxy to Math.ceil method, but with scientific notation to deal with decimals
Kind: static method of Utils
Access: public
Since: 1.0.0
Param | Type | Description |
---|---|---|
num | number |
The number to be rounded to the next bigger value |
[decimals] | number |
The number of decimals that will be used |
A proxy to Math.floor method, but with scientific notation to deal with decimals
Kind: static method of Utils
Access: public
Since: 1.0.0
Param | Type | Description |
---|---|---|
num | number |
The number to be rounded to the next lesser value |
[decimals] | number |
The number of decimals that will be used |
Rounds a number to the nearest even number
Kind: static method of Utils
Access: public
Since: 1.0.0
Param | Type | Description |
---|---|---|
num | number |
The number to be rounded to the next even value |
[decimals] | number |
The number of decimals that will be used |
Generates a random float number
Kind: static method of Utils
Access: public
Since: 1.0.0
Param | Type | Description |
---|---|---|
[min] | number |
The minimum value to be generated. If only one value is passed as an argument then this value is considered a max. |
[max] | number |
The maximum value to be generated. |
Generates a random integer number
Kind: static method of Utils
Access: public
Since: 1.0.0
Param | Type | Description |
---|---|---|
[min] | number |
The minimum value to be generated. If only one value is passed as an argument then this value is considered a max. |
[max] | number |
The maximum value to be generated. |
Returns -1 if the number passed is negative, +1 e its positive or 0 if its 0
Kind: static method of Utils
Throws:
TypeError
Access: public
Since: 1.0.0
Param | Type | Description |
---|---|---|
num | number |
A number on which the direction will be discovered |
A method factory to deal with decimals
Kind: global function
Since: 1.0.0
Param | Type | Description |
---|---|---|
func | function |
The function that will deal with decimals |