math.log10

The math.log10 function returns the decimal logarithm of the number passed as an argument. This function is usually more accurate than math.log(x, 10).

Submitted by admin on Sun, 01/31/2021 - 22:25

math.log2

The math.log2 function returns the logarithm to base 2 of the number passed as an argument.

Submitted by admin on Sun, 01/31/2021 - 22:18

math.log1p

The math.log1p function returns the natural logarithm of 1 + x. For small x values, this function returns a more accurate result than math.log(1 + x).

Submitted by admin on Sat, 01/30/2021 - 10:56

math.log

If used with an argument, x, the math.log function returns the natural or Naperian logarithm of x. If the second parameter, base, is added, the math.log function returns the logarithm of x in the indicated base.

Submitted by admin on Sat, 01/30/2021 - 10:13

math.expm1

The math.expm1 function returns the number e (2.718281...) raised to the power indicated as an argument after subtracting 1 from the result obtained.

As indicated in the Python documentation, for small values of x the result obtained by math.expm1(x) is much more accurate than that obtained by math.exp(x) -1.

Submitted by admin on Fri, 01/29/2021 - 16:07

math.exp

The math.exp function raises the number e (2.718281...) to the power given as an argument.

As stated in the Python documentation, this function is more accurate than math.e ** x, or pow(math.e, x).

Submitted by admin on Fri, 01/29/2021 - 15:57

math.prod

The math.prod function calculates the product of all elements of the iterable included as the first argument. The start parameter determines the first value to consider in the multiplication.

If the iterable is empty, the value start is returned.

Submitted by admin on Thu, 01/28/2021 - 10:10

math.trunc

The math.trunc function returns the integer part of the number x (the part to the left of the decimal separator), keeping its sign.

Submitted by admin on Wed, 01/27/2021 - 13:26

math.remainder

The math.remainder function returns the remainder of the division of "x" and "y" according to the criteria imposed by the IEEE 754 standard. This remainder is the difference of x-(n*y) for the integer value n closest to the integer part of the x/y quotient (be it greater or less than this quotient). If the integer part of x/y is at the same distance from two integers, the integer with even value is considered (see example below).

Submitted by admin on Tue, 01/26/2021 - 13:52

math.perm

The math.perm function returns the number of permutations without repetition of n elements grouped in blocks of k elements.

If the parameter k is not specified or if it takes the value None, k defaults to n and the function returns n!.

Submitted by admin on Mon, 01/25/2021 - 14:12