Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

question about float variables



hi all,

How to divide two numbers ?

I try this :

float var1=0.0
var1=$((2.4 + 1.4))
echo $var1

return 3.800000000e+00 good !!

but

float var1=0.0
var1=$((3 / 2)) 
echo $var1

return 1.000000000e+00 not good ! :(

and how to format the output of $var1 ?
(i want a number like 95.3)

Thank you very much

-- 
 Bruno Bonfils
 Admin Sys Linux

 http://www.darksnow.org  http://www.debian-fr.org
 http://www.zshfr.org

Attachment: pgpn9xfi9WKF5.pgp
Description: PGP signature



Messages sorted by: Reverse Date, Date, Thread, Author