Hi all,
I wonder how I can use binary logarithm in Solaris shell.
I'm aware of the natural logarithm as discussed on the following post:
Do you have any idea ?
Thanks in advanced,
Yigal
Hi all,
I wonder how I can use binary logarithm in Solaris shell.
I'm aware of the natural logarithm as discussed on the following post:
Do you have any idea ?
Thanks in advanced,
Yigal
Google is you friend!
An easy way to calculate the log2(n) on calculatorCalculator
A calculator is a device for performing calculations....
s that do not have a log2-function is to use the natural logarithmNatural logarithm
The natural logarithm, formerly known as the hyperbolic logarithm, is the logarithm to the base e, where e is equal ...
"ln" or the common logarithmCommon logarithm
In mathematics, the common logarithm is the logarithm with base 10....
"log" functions, which are found on most "scientific calculators". The formulaeLogarithm
The logarithm is the mathematical operation that is the inverse of exponentiation ....
for this are:
log2(n) = ln(n)/ln(2) = log(n)/log(2)
so
log2(n) = loge(n)�1.442695... = log10(n)�3.321928...
Thanks !!!
Yigal
Ydekel, you don't say which version of Solaris you are using. If you are on the latest and greatest, the default shell is now ksh93 which includes built-in support for most of the libm math functions. Here is an example
$ print $(( log(10) ))
2.30258509299405
$ print $(( logb(10) ))
3
Hi,
Actually I'm using bash on Solaris 8.5
Yigal