xtd 0.2.0
Loading...
Searching...
No Matches

◆ log() [2/2]

static double xtd::math::log ( double  a,
double  new_base 
)
static

Returns the logarithm of a specified number in a specified base.

Parameters
aThe number whose logarithm is to be found.
new_baseThe base of the logarithm.
Returns
One of the values in the following table. (+Infinity denotes math::positive_infinity, -Infinity denotes math::negative_infinity, and math::NaN denotes math::NaN.)
a new_base Return value
a > 0 (0 < new_base < 1)
-or-
(new_base > 1)
log new_base (a)
a < 0 (any value) xtd::math::NaN
(any value) new_base < 0 xtd::math::NaN
a != 1 new_base = 0 xtd::math::NaN
a != 1 new_base = xtd::math::positive_infinity xtd::math::NaN
a = xtd::math::NaN (any value) xtd::math::NaN
(any value) new_base = xtd::math::NaN xtd::math::NaN
(any value) new_base = 1 xtd::math::NaN
a = 0 0 < new_base < 1 xtd::math::positive_infinity
a = 0 new_base > 1 xtd::math::negative_infinity
a = xtd::math::positive_infinity 0 < new_base < 1 xtd::math::negative_infinity
a = xtd::math::positive_infinity new_base > 1 xtd::math::positive_infinity
a = 1 new_base = 0 0
a = 1 new_base = xtd::math::positive_infinity 0