Binary logarithm


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Binary logarithm
# 1  
Old 12-16-2008
Binary logarithm

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:

https://www.unix.com/shell-programmin...logarithm.html

Do you have any idea ?

Thanks in advanced,
Yigal
# 2  
Old 12-16-2008
Google is you friend!
Code:
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...

# 3  
Old 12-16-2008
Thanks !!!

Yigal
# 4  
Old 12-17-2008
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
Code:
$ print $(( log(10) ))
2.30258509299405
$ print $(( logb(10) ))
3

# 5  
Old 12-20-2008
Hi,

Actually I'm using bash on Solaris 8.5

Yigal
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert binary file to csv and then back to the binary format

Hello *nix specialists, Im working for a non profit organisation in Germany to transport DSL over WLAN to people in areas without no DSL. We are using Linksys WRT 54 router with DD-WRT firmware There are at the moment over 180 router running but we have to change some settings next time. So my... (7 Replies)
Discussion started by: digidax
7 Replies

2. SCO

Binary compatibility

Hi I'm going to buy C-ISAM 7.25 under sco unixware 7 to install in sco openserver 5.0.7. I'm wondering sco unixware 7 and sco openserver 5.0.6 are binary compatibles ? tnx (1 Reply)
Discussion started by: javad1_maroofi
1 Replies

3. Emergency UNIX and Linux Support

Which OS Binary was build

We have recently installed RHEL 5.4 on some existing 6.2 OS and migrated our code from RH 6.2 to RHEL 5.4. We are facing a difficulty that given a binary (on both OS they have same name) how can we distinguish that which gcc and OS it was build as there are some minor differences in between binary... (2 Replies)
Discussion started by: uunniixx
2 Replies

4. Shell Programming and Scripting

binary to ascii

Hi, Is there a way to convert the binary file to ascii . the binary file is pipe delimited. from source the file(pipe delimited) is ftped to mainframe and from mainframe it is ftped to the unix box using binary format. Is there a way to change it back to ascii and view it? Thanks! (3 Replies)
Discussion started by: dnat
3 Replies

5. Shell Programming and Scripting

logarithm

Hi Guys, Is it possible to do Logarithm of a number in Unix?? i dunno how to handl logarithm operation (4 Replies)
Discussion started by: ROOZ
4 Replies

6. Solaris

compiled binary file gives "cannot execute binary file"

Hi, I have two Solaris machines. 1. SunOS X 5.8 Generic_108528-29 sun4u sparc SUNW,Sun-Blade-1500 2. SunOS Y 5.8 Generic_108528-13 sun4u sparc SUNW,Ultra-60 I am trying to buiild a project on both these machines. The Binary output file compiled on machine 2 runs on both the machines. Where... (0 Replies)
Discussion started by: scgupta
0 Replies

7. UNIX for Dummies Questions & Answers

binary file

please let me know how can i mail the binary files is it can be done thru pine? is there any other way to do it? wat are the changes in system i have to make and one more thing i am sending data to a message queue and then retriving the data from the queue but when i do the ipcs... (1 Reply)
Discussion started by: ramneek
1 Replies

8. UNIX for Dummies Questions & Answers

Where is M4 binary?

Hello, I am configurating Sendmail on Mac OS 10.x terminal. I tried to execute m4 to generate a new sendmail.cf. It complains "Command not found". Anybody knows where the m4 binary is? Is it something coming along with Unix or Sendmail? Appreciate any help. Thanks in advance. pw (2 Replies)
Discussion started by: hypamw
2 Replies

9. UNIX for Dummies Questions & Answers

I'm looking for someone who have Base64 binary

I need to install the base64 encryption method on a UNIX machine under AIX5.2. I've received a tar file but it is only C source , can you help me please. (sending me a binary base64 or to compile my source) Thanks by advance (3 Replies)
Discussion started by: Bruno_LAMOUR
3 Replies
Login or Register to Ask a Question