Problem: How to evaluate Floating point Arithmetic operation in Unix?
In UNIX, as we know, ‘expr’ is used to evaluate arithmetic operation but it is not used to evaluate floating point valued expression. See the below image for more clarification:
Now, One more command is used to evaluate arithmetic expression , i.e. bc command.
Now Question should be such:
How do we evaluate Floating point Arithmetic expression in Unix?
We can mention ‘scale’ command while evaluating an arithmetic expression using ‘bc’ command. Scale command specifies the number of digits after the decimal point.
For example: Look at the below attached image explaining everything about the evaluation of floating point arithmetic expression.