Library "calc"
Library for math functions. will expand over time.
split(_sumTotal, _divideBy, _forceMinimum, _haltOnError)
Split a large number into integer sized chunks
Parameters:
_sumTotal: (int) Total numbert of items
_divideBy: (int) Groups to make
_forceMinimum: (bool) force minimum number 1/group
_haltOnError: (bool) force error if too few groups
Returns: int array of items per group
Library for math functions. will expand over time.
split(_sumTotal, _divideBy, _forceMinimum, _haltOnError)
Split a large number into integer sized chunks
Parameters:
_sumTotal: (int) Total numbert of items
_divideBy: (int) Groups to make
_forceMinimum: (bool) force minimum number 1/group
_haltOnError: (bool) force error if too few groups
Returns: int array of items per group
Versionsinformation:
v2
Added:
gapSize(_value1, _value2)
Absolute distance between any two float values, agnostic to +/-
Parameters:
_value1: First value
_value2: Second value
Returns: Absolute Positive Distance
simplifyFraction(_num, _den)
Parameters:
_num: (int) Input fraction numerator
_den: (int) Input fraction dennominator
Returns: Simplified Fraction
toFraction(_input, _round)
Convert Decimal to tuple fraction Output, Rounded to tick, Round Shorter if heavy use.
Parameters:
_input: Decimal Input
_round: (OPTIONAL) round shorter to speed up.
Returns: Simplified Fraction (if negative, Numerator gets the sign)
Added:
gapSize(_value1, _value2)
Absolute distance between any two float values, agnostic to +/-
Parameters:
_value1: First value
_value2: Second value
Returns: Absolute Positive Distance
simplifyFraction(_num, _den)
Parameters:
_num: (int) Input fraction numerator
_den: (int) Input fraction dennominator
Returns: Simplified Fraction
toFraction(_input, _round)
Convert Decimal to tuple fraction Output, Rounded to tick, Round Shorter if heavy use.
Parameters:
_input: Decimal Input
_round: (OPTIONAL) round shorter to speed up.
Returns: Simplified Fraction (if negative, Numerator gets the sign)
Versionsinformation:
v3
Versionsinformation:
v4
Added:
percentile(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
Parameters:
signal: value to check
_startVal: first value limit
_endVal: second value limit
pow10up(_src, _pow)
Power of 10 scale up
Parameters:
_src: Input value
_pow: Number of * 10 to perform
pow10dn(_src, _pow)
Power of 10 scale down
Parameters:
_src: Input value
_pow: Number of / 10 to perform
pow10chk(_src)
Power of 10 to req to integer
Parameters:
_src: Input value) =>
Added:
percentile(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
Parameters:
signal: value to check
_startVal: first value limit
_endVal: second value limit
pow10up(_src, _pow)
Power of 10 scale up
Parameters:
_src: Input value
_pow: Number of * 10 to perform
pow10dn(_src, _pow)
Power of 10 scale down
Parameters:
_src: Input value
_pow: Number of / 10 to perform
pow10chk(_src)
Power of 10 to req to integer
Parameters:
_src: Input value) =>
Versionsinformation:
v5
Major speed improvement on fractions (Thank you Stack overflow)
Fix on Output for start/end == same values on percent, and rename
now gets 0 if starrt == end.
Added:
percentOfDistance(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
Parameters:
signal: value to check
_startVal: first value limit
_endVal: second value limit
fractionOfDistance(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
Parameters:
signal: value to check
_startVal: first value limit
_endVal: second value limit
Returns: fraction
pow10(_src, _pow)
Power of 10 scale up
Parameters:
_src: Input value
_pow: Number of * 10 to perform
Returns: Value with decimal moved + right, - left
Updated:
toFraction(_input, _epsilon, _iterations)
Convert Decimal to tuple fraction Output, 1/0 resolves to
note : it is suboptimal, will be updating with a much faster algorithm
Parameters:
_input: Decimal Input
_epsilon: (OPTIONAL) to precision (10e-N)
_iterations: Maximum iterations (OPTIONAL)
Returns: Simplified Fraction (if negative, Numerator gets the sign)
Removed:
percentile(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
pow10up(_src, _pow)
Power of 10 scale up
pow10dn(_src, _pow)
Power of 10 scale down
Major speed improvement on fractions (Thank you Stack overflow)
Fix on Output for start/end == same values on percent, and rename
now gets 0 if starrt == end.
Added:
percentOfDistance(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
Parameters:
signal: value to check
_startVal: first value limit
_endVal: second value limit
fractionOfDistance(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
Parameters:
signal: value to check
_startVal: first value limit
_endVal: second value limit
Returns: fraction
pow10(_src, _pow)
Power of 10 scale up
Parameters:
_src: Input value
_pow: Number of * 10 to perform
Returns: Value with decimal moved + right, - left
Updated:
toFraction(_input, _epsilon, _iterations)
Convert Decimal to tuple fraction Output, 1/0 resolves to
note : it is suboptimal, will be updating with a much faster algorithm
Parameters:
_input: Decimal Input
_epsilon: (OPTIONAL) to precision (10e-N)
_iterations: Maximum iterations (OPTIONAL)
Returns: Simplified Fraction (if negative, Numerator gets the sign)
Removed:
percentile(signal, _startVal, _endVal)
Measure percent (0.##) of Distance between two points
pow10up(_src, _pow)
Power of 10 scale up
pow10dn(_src, _pow)
Power of 10 scale down
Versionsinformation:
v6
Added:
from_center(_src, _mid)
Parameters:
_src (float)
_mid (float)
Added:
from_center(_src, _mid)
Parameters:
_src (float)
_mid (float)