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

Re: print and floating point output

    Hi Matthias :)

 * Matthias Kopfermann <matthi@xxxxxxxxxxxxxxxxx> dixit:
> I wonder if it really was a good decision to print so many numbers
> after the point.
> When asking Sven W9y he told me that that's a problem of
> gcc's printf/fprintf which indeed gives that result when using it with
> more than 15 numbers after the point.

    Not in my system, at least :? Could you point to an example?
> on the other hand perl, ruby and python all return
> the right result:
> perl -le 'print 2.8*16.0' => 44.8
> python -c 'print 2.8*16.0' => 44.8
> ruby -e 'puts 2.8*16.0' => 44.8
> so i guess it would make a lot sense and not cause confusion if zsh
> would have a more sensible output with `print' and for users
> not using `printf'.

    You're right. 'printf' from coreutils-5.2.1 works ok and prints
the correct number.

    Raúl Núñez de Arenas Coronado

Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/

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