> Machine Type: i586-mandrake-linux-gnu
>
>
> Bash Version: 2.05b
> Patch Level: 0
> Release Status: release
>
>
> Description:
> printf builtin rounds some decimals incorrectly.
>
>
> Repeat-By:
> $ printf %.f 1.000000000000000000001; echo
> 0
> $ printf %.f 1.00000000000000000001; echo
> 0
> $ printf %.f 1.0000000000000000001; echo
> 1
> $ printf %.f 1.00000000000000000000; echo
> 1
The printf builtin doesn't really do any rounding itself. It calls strtold
to convert the argument and printf to print it. I'd say the problem lies in
the C library, especially since I can reproduce the above error only on
Red Hat Linux 8.0.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU chet@po.cwru.edu http://tiswww.tis.cwru.edu/~chet/