LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bash arithmetic question (https://www.linuxquestions.org/questions/linux-newbie-8/bash-arithmetic-question-844424/)

ghantauke 11-15-2010 02:27 PM

bash arithmetic question
 
$(()) doesn't seem to work with real numbers such as 1.2. HELP!

Dark_Helmet 11-15-2010 02:33 PM

Code:

math_result=$(echo "1.234 * 0.987" | bc -l)

ghantauke 11-15-2010 02:43 PM

Quote:

Originally Posted by Dark_Helmet (Post 4159776)
Code:

math_result=$(echo "1.234 * 0.987" | bc -l)

Thanks a bunch.

onebuck 11-15-2010 04:19 PM

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.
:hattip:

ghantauke 11-15-2010 04:47 PM

Quote:

Originally Posted by onebuck (Post 4159916)
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.
:hattip:


"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


All times are GMT -5. The time now is 02:52 PM.