A chain-able, small, quick maths+utils lib
qm(4).plus(1).dividedby(2).fin()
->2.5
$ yarn add quick-maths
const qm = require('quick-maths');
// or
import qm from 'quick-maths';
qm(1).times(-5).dividedby(3).minus(1).plus(5).times(2).fin(2)
//=> 4.66
qm(5).times(-5).fin()
//=> -25
qm(10).roughly(10.3)
//=> true
qm(10).equals(1850)
//=> false
Type: int/float
The initial that quick maths will evaluate with. Used as the beginning chain component.
Type: int/float
Value that will be added to the current number.
Type: int/float
Value that current number will be subtracted by.
Type: int/float
Value that the current number will be multiplied by.
Type: int/float
Value that the current number will be divided by.
Type: int/float
Value that is checked to see if it equal to the current number. Used as an ending chain component, nothing after will be calculated.
Type: int/float
Value that is checked to see if it is within 0.5 of the current number. Used as an ending chain component, nothing after will be calculated.
Type: int
Value that will truncate decimal places, not round. Used as THE ending chain component, not to be used after .roughly or .equals.
MIT © Evan Kysley