ilog - Maple Help

ilog2

compute integer base 2 logarithm

ilog10

compute integer base 10 logarithm

ilog[b]

compute integer base b logarithm

Calling Sequence

 ilog2(x) ilog10(x) ilog[b](x) ${\mathrm{ilog}}_{b}\left(x\right)$

Parameters

 x - expression b - positive real number

Description

 • These functions compute integer approximations to logarithms of x. They are  based on the IEEE function logb.
 • The ilog[b](x) function approximates the integer base b logarithm, where the default base is exp(1).
 • You can enter the command ilog[b] using either the 1-D or 2-D calling sequence. For example, ilog[2](50) is equivalent to ${\mathrm{ilog}}_{2}\left(50\right)$.
 • If x is real, ilog[b](x) returns r such that ${b}^{r}\le |x|<{b}^{r+1}$.
 • The ilog2(x) function returns the integer base 2 logarithm of x.
 If x is real and r = ilog2(x), then r is either an exact integer or special symbolic value, and ${2}^{r}\le |x|<{2}^{r+1}$.
 If x is a complex numeric, ilog2(x) returns  max(ilog2(Re(x)), ilog2(Im(x))).
 If x is a special symbolic value, the indicated result is returned.

 1.  $\mathrm{ilog2}\left(\mathrm{undefined}\right)=\mathrm{undefined}$ 2.  $\mathrm{ilog2}\left(±\infty \right)$ = $\mathrm{\infty }$ 3.  $\mathrm{ilog2}\left(±0\right)$ = $-\mathrm{\infty }$

 • The ilog10(x) function returns the integer base 10 logarithm of x.
 If x is real, ilog10(x) returns r such that r is either an exact integer or special symbolic value, and${10}^{r}\le |x|<{10}^{r+1}$.
 If x is a complex numeric, ilog10(x) returns  max(ilog10(Re(x)), ilog10(Im(x))).
 If x is a special symbolic value, the indicated result is returned.

 1.  $\mathrm{ilog10}\left(\mathrm{undefined}\right)=\mathrm{undefined}$ 2.  $\mathrm{ilog2}\left(±\infty \right)$ = $\mathrm{\infty }$ 3.  $\mathrm{ilog2}\left(±\infty \right)$ = $-\mathrm{\infty }$

 • The computation of ilog2(x) and ilog10(x) is more efficient than ilog[b](x), b <> 2, 10.

 • The ilog2 and ilog10 commands are thread-safe as of Maple 15.

Examples

 > $\mathrm{ilog10}\left(x\right)$
 ${\mathrm{ilog10}}{}\left({x}\right)$ (1)
 > $\mathrm{ilog10}\left(150\right)$
 ${2}$ (2)
 > $\mathrm{ilog10}\left({10}^{-37}\right)$
 ${-37}$ (3)
 > $\mathrm{ilog10}\left({2}^{14}+{3}^{10}I\right)$
 ${4}$ (4)
 > $\mathrm{ilog2}\left(50\right)$
 ${5}$ (5)
 > $\mathrm{ilog}\left[2\right]\left({2}^{8}\right)$
 ${8}$ (6)
 > $\mathrm{ilog}\left[3\right]\left(10\right)$
 ${2}$ (7)
 > $\mathrm{ilog}\left[\mathrm{exp}\left(1\right)\right]\left(3\right)$
 ${1}$ (8)