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

Re: Bug#164686: zsh: Wrong floatting point operation (when locale_decimal_sign=","?)



> Here is the log of a repetible, wrong session of zsh:
> 
> $ LANG=it_IT@euro zsh
> debian% a=4003
> debian% b=4
> debian% typeset -F 4 a
> debian% typeset -F 4 c
> debian% c=$((a/b))
> debian% print $c
> 75,0000
> debian% c=5.5
> debian% c=$((a/b))
> debian% print $c
> 1000.7500
> debian% exit
> 
> And here is the correct one:
> 
> $ LANG=C zsh
> debian% a=4003
> debian% b=4
> debian% typeset -F 4 a
> debian% typeset -F 4 c
> debian% c=$((a/b))
> debian% print $c
> 1000.7500
> debian% exit
> 
> I think the problem reside in the fact that in italian we write
> 4003/4 = 1.000,75

Do we need another set of setlocale() calls somewhere?



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