LOG()

From Liberty BASIC Family
Jump to navigation Jump to search
Supported in Just BASIC Supported in Liberty BASIC Not supported in Liberty BASIC 5 Not supported in Run BASIC

Description

This function returns the natural logarithm of the given number or expression.
The opposite is the EXP() function.

Syntax

  1. LOG(Number)

Hints

Place useful hints about this keyword here

Example

Print LOG(1)
Print LOG(0.5)
Print LOG(0.2)
Print LOG(2*5)
End

Useful Procedures

function log10(n)
    'returns the common logarithm of n
    log10 = log(n) / log(10)
end function

function log2(n)
    'returns the binary logarithm of n
    log2 = log(n) / log(2)
end function