[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: printf-frexp and the radix of floating point numbers

**From**: |
Bruno Haible |

**Subject**: |
Re: printf-frexp and the radix of floating point numbers |

**Date**: |
Thu, 1 Mar 2007 00:26:19 +0100 |

**User-agent**: |
KMail/1.5.4 |

Paul Eggert wrote:
>* A more up-to-date mainframe C compiler would be Systems/C*
>* <http://www.dignus.com/dcc/>. Its most recent release is 1.85*
>* (released 2006-09-01). It supports some C99 features but not all, and*
>* its documentation doesn't claim support for printf 'a' and 'A'.*
OK, but nevertheless the practical problem is: Even if I wanted to adjust
the printf-frexp and the 'a'/'A' conversion code to avoid rounding errors
on such platforms, I don't have enough info about how to do it.
If FLT_RADIX = 16, multiplication of a number with 2.0 causes rounding
errors for 25% of the numbers, and multiplication with 0.5 causes rounding
errors for 75% of the numbers. (Btw, this makes it impossible to implement
a C99 compatible frexp() function, no?) I would at least need to know
whether the rounding problem when multiplying with 2.0 occurs in the
range [1.0,2.0) or [2.0,4.0) or [4.0,8.0) or [8.0,16.0).
Bruno