# How to do floating point arithmetic in Shell programming?



## hafees (Mar 25, 2005)

is there any direct method to do floating point arithmetics in shell programming ? using expr or something. pls help


----------



## GNUrag (Mar 27, 2005)

You can use expr to evaluate expressions like you'd have seen in many shell tutorials.

But for floating point maths you can use the * bc * utility. GNU bc does not require the separate dc program, which is another GNU calculator utility

Read this example cum documentation to understand how to invoke and integrate bc with your shell script.
*www.gnu.org/software/bc/manual/html_mono/bc.html#SEC19


----------



## hafees (Mar 28, 2005)

i ve saved the page. thnx.


----------

