Skip to content

clovislima/mathematical

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Dependency Status devDependency Status

Objects

Mathematical : object

Mathematical is a collection of methods to help dealing with the Number class in javascript

Functions

decimalsCurry(func)function

A method factory to deal with decimals

Mathematical : object

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.Utils : object

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.round(num, [decimals]) ⇒ Number

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

Utils.ceil(num, [decimals]) ⇒ Number

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

Utils.floor(num, [decimals]) ⇒ Number

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

Utils.roundToEven(num, [decimals]) ⇒ Number

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

Utils.random([min], [max]) ⇒ Number

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.

Utils.randomInt([min], [max]) ⇒ Number

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.

Utils.getDirection(num) ⇒ Number

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

decimalsCurry(func) ⇒ function

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

About

A Math module to help dealing with some math issues

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published