log2

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the log2 of <number>
log2(<number>)
Summary

Returns the base-2 logarithm of a number.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
number

A positive number, or an expression that evaluates to a positive number.

Example
log2(8) -- returns 3
log2(0.125) -- returns -3
Values
NameTypeDescription
return

The log2 function returns a number.

RelatedControl Structure: function
Glossary: return, math operation
Function: ln1
Description

Use the log2 function to obtain a base-2 logarithm.

The base-2 logarithm of a number is the power to which 2 must be raised to obtain the number : 2^log2(number) is equal to number.

If a math operation on finite inputs produces a non-finite output, an execution error is thrown. See math operations for more information.

Tagsmath