Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 25-03-2005, 12:07 AM   #1 (permalink)
In The Zone
 
hafees's Avatar
 
Join Date: Feb 2004
Location: Kerala
Posts: 405
Default How to do floating point arithmetic in Shell programming?



is there any direct method to do floating point arithmetics in shell programming ? using expr or something. pls help
__________________
Quitters Never Win & Winners Never Quit!
hafees is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 27-03-2005, 05:12 PM   #2 (permalink)
FooBar Guy
 
GNUrag's Avatar
 
Join Date: Jun 2004
Location: GNUmbai
Posts: 1,245
Default

You can use expr to evaluate expressions like you'd have seen in many shell tutorials.

But for floating point maths you can use the bc utility. GNU bc does not require the separate dc program, which is another GNU calculator utility

Read this example cum documentation to understand how to invoke and integrate bc with your shell script.
http://www.gnu.org/software/bc/manua.../bc.html#SEC19
__________________
- --
http://web.gnuer.org
GNUrag is offline  
Old 28-03-2005, 12:32 AM   #3 (permalink)
In The Zone
 
hafees's Avatar
 
Join Date: Feb 2004
Location: Kerala
Posts: 405
Default

i ve saved the page. thnx.
__________________
Quitters Never Win & Winners Never Quit!
hafees is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


 
Latest Threads
- by Charan
- by Charan

Advertisement




All times are GMT +5.5. The time now is 05:20 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2