LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-15-2010, 03:27 PM   #1
ghantauke
Member
 
Registered: Nov 2010
Posts: 114

Rep: Reputation: 6
bash arithmetic question


$(()) doesn't seem to work with real numbers such as 1.2. HELP!
 
Old 11-15-2010, 03:33 PM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
Code:
math_result=$(echo "1.234 * 0.987" | bc -l)
 
Old 11-15-2010, 03:43 PM   #3
ghantauke
Member
 
Registered: Nov 2010
Posts: 114

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by Dark_Helmet View Post
Code:
math_result=$(echo "1.234 * 0.987" | bc -l)
Thanks a bunch.
 
Old 11-15-2010, 05:19 PM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,892
Blog Entries: 27

Rep: Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183
Hi,

Welcome to LQ!

Instead of throwing out your homework for others to do, why not abide by the LQ Rules;
Quote:
Do not expect LQ members to do your homework - you will learn much more by doing it yourself.
If you don't understand something then approach the forum or your instructor with questions about the assignment or your attempts.
You have been creating a lot of threads for homework questions to the forum! You would learn more and understand the subject better if YOU do the work.
 
Old 11-15-2010, 05:47 PM   #5
ghantauke
Member
 
Registered: Nov 2010
Posts: 114

Original Poster
Rep: Reputation: 6
Quote:
Originally Posted by onebuck View Post
Hi,

Welcome to LQ!

Instead of throwing out your homework for others to do, why not abide by the LQ Rules;
If you don't understand something then approach the forum or your instructor with questions about the assignment or your attempts.
You have been creating a lot of threads for homework questions to the forum! You would learn more and understand the subject better if YOU do the work.

"This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!"

That is what's written in the forum I've posted my questions. I have a lot of questions about linux since I'm new to it. Also I haven't told anyone to do my work. All I have done is ask question about something I'm unclear about. If I'm not posting in the right forum please do tell me where to post it. As far as I'm aware I am abiding by the rules. I might be missing something so please clearly state what I've done wrong.
Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
bash, for loop, and arithmetic rmount Programming 13 05-23-2007 02:27 AM
BASH, simple arithmetic helptonewbie Programming 9 01-10-2007 06:53 PM
Bash arithmetic Blackout_08 Programming 2 06-08-2006 11:37 PM
simple arithmetic in bash gfrair Linux - Newbie 9 03-16-2005 03:09 PM
Bash, non-integers and arithmetic causticmtl Programming 5 07-16-2003 10:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:28 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration