Skip to content

Releases: zdodson21/mathfun-lib

Percent Function

28 Oct 12:12

Choose a tag to compare

Percent Function Pre-release
Pre-release

Percent function added

Ex: percent(72, 5) = 5% * 72 = 3.6

Pre-stable Version

22 Oct 20:34

Choose a tag to compare

Pre-stable Version Pre-release
Pre-release

Note: This library is not yet in a stable state. Exponent function cannot calculate with decimals powers (which results in root function not working yet either)

The following functions are available:

  • add(a, b) - Calculates the sum of values a & b

  • subtract(a, b) - Calculates the difference of b subtracted from a

  • multiply(a, b) - Calculates the product of values a & b

  • divide(a, b) - Calculates the quotient of a divided by b

  • one_over(a) - Calculates the quotient of 1 divided by a

  • is_whole_num(a) - Returns whether or not a is a whole number

  • is_even(a) - Returns whether or not a is an even number

  • am(a, b) - Calculates the Arithmetic Mean of provided values a & b

  • gm(a, b) - Calculates the Geometric Mean of provided values a & b

  • agm(a, b) - Calculates the Arithmetic-Geometric Mean of a and b

  • sq_root(a) - Calculates the square root of a

  • ln(a) - Calculates the natural log of a using the formula in formulas/natural-log.odf. This file can be opened w/ LibreOffice Math

    • Note: The results returned from this function will start to lose precision around the hundred thousandths decimal place.
  • log(base, arguement) - Calculates the logarithm of base & arguement

  • exponent(base, exponent) - Calculates the value of base to the exponent power

    • Note: This only works when the exponent is a whole number (currently)
  • root(index, radicand) - Calculates the value of index to the root of radicand