Log

From AutoIt Wiki

Jump to: navigation, search

Calculates the natural logarithm of a number. Adapted from AutoIt docs.

Contents

Syntax

$x = Log(expr)

Parameters

exprAny positive number.

Return Value

Success: Returns the expression's natural logarithm.
Failure: Tends to return -1. #IND for non-positive expressions.

@error is always 0

Example

$x = Log(1000)   ;returns 6.90775527898214

$y = Log10(1000) ;returns 3

; user-defined function for common log
Func Log10($x)
    Return Log($x) / Log(10)  ;10 is the base
EndFunc

Related Functions

Exp

Personal tools