How to do integer & float calculations, in bash or other languages/frameworks?
429
votes
17
answers
663564
views
Using
echo "20+5"
literally produces the text "20+5
".
What command can I use to get the numeric sum, 25
in this case?
Also, what's the easiest way to do it just using bash for floating
point? For example, echo $((3224/3807.0))
prints 0
:(.
I am looking for answers using either the basic command shell ('command
line') itself or through using languages that are available from the
command line.
Asked by Michael Durrant
(43563 rep)
Jun 14, 2012, 02:43 PM
Last activity: Nov 26, 2024, 11:07 AM
Last activity: Nov 26, 2024, 11:07 AM