bash does not natively support floating point arithmetic, so we must rely on external utilities if we want to deal with decimal numbers. A common choice for this is bc. Fun fact: bc is actually it's own complete language! We commonly access bc via a pipe (represented as |), which allows the output of one command to be used as the input for ...Arithmetic in BASH is integer math only. You can't do floating point math in Bash; if you need that capability, see Bash FAQ #22.. Also see the Bash hackers article about the full syntax theory.. There are several ways to tell Bash to treat numbers as integers instead of strings, and to do basic arithmetic operations on them.As others have indicated, bash does not have built-in floating-point operators. You can implement floating-point in bash, even without using calculator programs like bc and awk, or any external programs for that matter. I'm doing exactly this in my project, shellmath, in three basic steps: Break the numbers down into their integer and fractional parts Floating-point Math with bc. The Bash interpreter has no built-in commands to handle floating-point calculations or complex mathematical functions like those for trigonometry. In practice, this has never been a problem, thanks to the command-line, script-ready calculator (and language) known as bc.As shells default to integer arithmetic, the only way I know to enable real arithmetic is through 'bc' You could use the 'two way pipe' to the program to do all your math operations, like this: #!/usr/bin/sh # This starts bc with a two-way pipe bc |& # print -p writes to the pipe print -p scale=2 print -p 3/4 # read -p reads from the pipeAs others have indicated, bash does not have built-in floating-point operators. You can implement floating-point in bash, even without using calculator programs like bc and awk, or any external programs for that matter. I'm doing exactly this in my project, shellmath, in three basic steps: Break the numbers down into their integer and fractional parts