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

LC_NUMERIC=fr_FR and floating point arithmetics



$ LC_NUMERIC=fr_FR ksh93 -c 'float a=1; echo $(( a / 3 ))'
0,333333333333
$ LC_NUMERIC=fr_FR zsh -c 'float a=1; echo $(( a / 3 ))'
0,33333333333333331.

zsh seems to assume that "." is the decimal separator which is
not correct in a french locale.

I agree this is confusing. A ksh93 script such as
echo $(( 1. / 3 ))

won't work under french locale.
(must be echo $(( 1, / 3 )) )

(tried with zsh 4.1.0-dev-7)

-- 
Stéphane



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