[Cfp-interest 2553] exact DFP from BFP

Fred J. Tydeman tydeman at tybor.com
Fri Oct 28 12:42:26 PDT 2022


Preferred quantum exponent for exact conversion from non-decimal
floating type.

Consider a binary float of 1/64 == 0.015625f converted (exactly) to
Decimal32.  I believe the DFP would be (+,15625,-6), rather than
(+,156250,-7) or (+,1562500,-8) or (+,0,0).  Correct?

If the above is correct, why does the "Preferred quantum exponents"
table in C23 in 5.2.4.2.3, around page 31, say it should be 0, instead
of -6 for this case?  Should it not be either "greatest possible" or
"least possible" instead of 0?


---
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.



More information about the Cfp-interest mailing list