Goto main content

log10

This function computes the base 10 logarithm of a number.

LOG10

NAME

log10 - This function computes the base 10 logarithm of a number.

SYNOPSIS

log10(number)

DESCRIPTION

This mathematical function allows the user to compute the base 10 logarithm of a number. This logarithm has the number 10 as its base. In litterature, you might find the log10 written as only log, since it is most commonly used for computations than the natural logarithm. The logarithm of a number x is the exponent y to which 10 must be raised to give x. This function is defined in the first and fourth quadrant, meaning that 0<x<INF and -INF<y<INF.

PARAMETERS

number
Specify the number (float) used as argument for the log10 function.

RETURN

The value of the base 10 logarithm.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

One can use this function with integers:

test(q(res={_{log10(45);}}.),q(res=1.65321.));

With floats:

test(q(res={_{log10(4.5);}}.),q(res=.653213.));

With another variable:

test(q(res={_{
%include "/includes/extenso.sn";
a=3;
log10(a);
}}.),
q(res=.477121.));

With a trigonometric function:

test(q(res={_{
%include "/includes/extenso.sn";
a=cos(0);
log10(a);
}}.),
q(res=0.));

With the limits:

test(q(res={_{
%include "/includes/extenso.sn";
log10(0);
}}.),
q(res=INF.));

With an array:

test(q(res={_{log10(1,3,4.5);}}.),q(res=\[0,.477121,.653213\].));

But not with negative numbers:

test(q(res={_{log10(-1);}}.),q(res=NAN.));

Since this function is defined in the first and fourth quadrant, the x must
always be positive. However, this returns an imaginary number, 1.36*i.

SEE ALSO

{{ include("includes/maths.sn") }}

AUTHOR

Written by Caroline Laplante, <claplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.