[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bugs in printf/sprintf formatted output
From: |
arnold |
Subject: |
Re: Bugs in printf/sprintf formatted output |
Date: |
Tue, 06 Aug 2024 12:03:37 -0600 |
User-agent: |
Heirloom mailx 12.5 7/5/10 |
Hi.
> > Please clarify. For non-MPFR the results are the same?
>
> They are.
Great, thanks.
> 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?
In any case, I will work on the new issues you've noted.
Thanks,
Arnold
- 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 <=
- Re: Bugs in printf/sprintf formatted output, Maciej W. Rozycki, 2024/08/07
- 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