Skip to content
Vašek edited this page Jan 13, 2019 · 2 revisions

logn

Returns the log base x of n

Syntax:

logn(x, n)
Argument Description
double x The log base
double n The input value

Returns: double

Description:

This function is similar to the log2 and log10 functions but in this function, your input is the log base. You are asking: "How many times x must be powered by to equal n?" For example, logn(3,27) will return 3, because 3x3x3 = 27.

Example:

double value;
value = power(5, 3);

This code set value to 125.

Example:

double value;
value = logn(6,36);

This code will set value to 2.

Example 2:

double value;
value = logn(10,0.01);

This code will set value to -1,999999.

Back to number_functions

Clone this wiki locally