[Cfp-interest 1695] Re: printf with %a

Jim Thomas jaswthomas at sbcglobal.net
Fri Jul 17 16:05:33 PDT 2020



> On Jul 17, 2020, at 8:57 AM, Fred J. Tydeman <tydeman at tybor.com> wrote:
> 
> Is
> printf("%-+#.0La", 3.0L);
> allowed to output  "+0x2.p+1"
> instead of "+0x3.p+1"
> for IEEE-754 binary floating-point?

I don’t see anything to prohibit it.

- Jim Thomas
.
> 
> C 7.21.6.1#11 has:
> For a and A conversions, if FLT_RADIX is a power of 2, the value is correctly rounded to a hexadecimal
> floating number with the given precision.
> 
> 
> ---
> Fred J. Tydeman        Tydeman Consulting
> tydeman at tybor.com      Testing, numerics, programming
> +1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")
> Sample C99+FPCE tests: http://www.tybor.com
> Savers sleep well, investors eat well, spenders work forever.
> 
> _______________________________________________
> Cfp-interest mailing list
> Cfp-interest at oakapple.net
> http://mailman.oakapple.net/mailman/listinfo/cfp-interest




More information about the Cfp-interest mailing list