[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bugs in printf/sprintf formatted output
From: |
Maciej W. Rozycki |
Subject: |
Re: Bugs in printf/sprintf formatted output |
Date: |
Wed, 7 Aug 2024 18:12:33 +0100 (BST) |
On Tue, 6 Aug 2024, arnold@skeeve.com wrote:
> > Try e.g. { printf "%.13a", -1.79769313486231570814527423731704357e+308 },
> > which prints "-0x1.fffffffffffffp+1023" (glibc implementation) or
> > "-0xf.ffffffffffff8p+1020" (MPFR implementation).
> >
> > That is aside from the default precision issue in the MPFR mode, where
> > e.g.: { printf "%a", -1.79769313486231570814527423731704357e+308 } prints
> > "-0x1.000000p+1024" in violation of POSIX, which says:
> >
> > "if the precision is missing and FLT_RADIX is a power of 2, then the
> > precision shall be sufficient for an exact representation of the value"
> > which obviously has not been met here (i.e. "-0xf.ffffffffffff8p+1020" is
> > supposed to be produced as with explicit precision of 13).
>
> Could you file a bug against MPFR?
I suppose I could, but the version installed on my test system is 4.0.2,
possibly with local patches applied by the distribution, so I'd have to
check at least the most recent release first (which I think is 4.1.0) if
not upstream master. Therefore I cannot promise any specific timeline for
such a bug report and as the owner of the code that triggers the issue you
may be in a better position to talk to MPFR maintainers anyway. I'll see
what I can do, but won't have a grudge against you if you beat me to it.
I'll appreciate your understanding.
Maciej
- Re: Bugs in printf/sprintf formatted output, arnold, 2024/08/05
- Re: Bugs in printf/sprintf formatted output, Maciej W. Rozycki, 2024/08/05
- Re: Bugs in printf/sprintf formatted output, arnold, 2024/08/06
- Re: Bugs in printf/sprintf formatted output, Maciej W. Rozycki, 2024/08/06
- Re: Bugs in printf/sprintf formatted output, arnold, 2024/08/06
- Re: Bugs in printf/sprintf formatted output, Maciej W. Rozycki, 2024/08/06
- Re: Bugs in printf/sprintf formatted output, arnold, 2024/08/06
- Re: Bugs in printf/sprintf formatted output,
Maciej W. Rozycki <=
- Re: Bugs in printf/sprintf formatted output, arnold, 2024/08/08
- Re: Bugs in printf/sprintf formatted output, arnold, 2024/08/06
- Re: Bugs in printf/sprintf formatted output, Maciej W. Rozycki, 2024/08/07
- Re: Bugs in printf/sprintf formatted output, arnold, 2024/08/08