log10 (argument -- decimalLogarithm)
Inputs
argument: Real object whose base-10 logarithm is taken.
Outputs
decimalLogarithm: Base-10 logarithm in the same real schema.
log10 accepts Real32 and Real64 objects. The input is dereferenced and must be non-NIL.
Behavior
- A known positive real produces the known base-10 logarithm in the same real schema.
- A known zero produces known negative infinity in the same real schema.
- A known negative real produces the real logarithm result, such as
nanr32for-1.0r32. - An unknown Real object produces an object with an unknown value of the same Real schema.
- The result keeps the same real schema as the input.
Example
{} () {} [
"-- real32 --" printCompilerMessage
100.0r32 log10 printStack _:;
0.0r32 log10 printStack _:;
-1.0r32 log10 printStack _:;
"-- real64 --" printCompilerMessage
100.0 log10 printStack _:;
0.0 log10 printStack _:;
-1.0 log10 printStack _:;
] "main" exportFunction
Expected Output During Compilation
-- real32 --
2.0r32
-infr32
nanr32
-- real64 --
2.0
-inf
nan
See also
^builtin(base exponent -- power)Raises one Real object to another of the same schema and keeps that real schema in the result.castbuiltin(object schema -- convertedValue)Casts a Cond or numeric object to the numeric schema selected by theschemainput.ceilbuiltin(object -- ceilingValue)Rounds a Real object upward and keeps the same real schema.cosbuiltin(angle -- cosine)Computes the cosine of a Real object and keeps the same real schema.floorbuiltin(object -- floorValue)Rounds a Real object downward and keeps the same real schema.logbuiltin(argument -- naturalLogarithm)Computes the natural logarithm of a Real object and keeps the same real schema.negbuiltin(object -- negatedValue)Negates a signed Int or Real object and keeps the same schema.sinbuiltin(angle -- sine)Computes the sine of a Real object and keeps the same real schema.sqrtbuiltin(radicand -- squareRoot)Computes the square root of a Real object and keeps the same real schema.