HyperTalk Reference
Home » HyperTalk Reference » Functions

Note: This is a work in progress and will be formatting errors. Read more about the project on the home page.

ln, ln1, log2

the ln of number
the ln1 of number
the log2 of number
Values returned:
ln returns a number equal to the base-e or natural logarithm of number.
ln1 returns a number equal to the natural logarithm of 1 + number.
ln2 returns a number equal to the base-2 logarithm of number.


the ln of 2.718282 --returns 1

ln1 of 1.718282 --returns 1

log2 of 1024 -- returns 10

log2 of 1024 - 512 -- returns -502
log2 of (1024 - 512)  -- returns 9


An expression that evaluates to a number.

For example:

169 / 19
(60.625 * 500)
i+1 -- (where i is a number)
line 1 of fld "Debits"

Note: Formally, HyperCard distinguishes between factors (simple values) and expressions. The difference between factors and expression matters only if you like to drop parentheses. Most functions take factors as their parameters, which is why abs of -10 + 2 returns 12 and abs of (-10 + 2) returns 8. In short, always use parentheses to group things the way you want them to evaluate, and you won’t have to worry about the difference between factors and expressions.

Related Topics

« length | HyperTalk Reference | max »

Version 0.7b1 (March 24, 2022)

Made with Macintosh

Switch to Modern View