LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-17-2007, 09:01 AM   #1
ztdep
Member
 
Registered: Jul 2005
Posts: 219

Rep: Reputation: 31
float operation in the scripte


Hi:
I want to know how to perform the float operation in the scripte file.
we can conduct the integer operation by, for example:
expr n=$1/6
Regards
 
Old 05-17-2007, 10:13 AM   #2
timvc
LQ Newbie
 
Registered: Nov 2006
Posts: 5

Rep: Reputation: 0
Hi,
One possibility is to use the program bc with option -l:

n=`echo "${1}/6" | bc -l`

cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
float to binary anoosh Programming 1 04-15-2006 02:45 AM
ASCII to float lucky6969b Programming 3 12-15-2005 02:52 AM
count digits of a float || convert float to string nadroj Programming 6 07-11-2005 04:52 PM
how big is a float in C? SciYro Programming 11 04-04-2005 09:24 AM
C newbie float ? bluesky Programming 7 09-03-2003 12:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration