[Cfp-interest 1966] DFP and static initialization

Fred J. Tydeman tydeman at tybor.com
Sun Apr 11 06:19:15 PDT 2021


A question for compiler writers that support decimal floating point (DFP).

What value and quantum exponent do you give a static decimal floating
point variable that gets the default initialization?

6.7.9 Initialization, paragraph 10, has (in part):
  If an object that has static or thread storage duration is not
  initialized explicitly, then: ... 
  if it has arithmetic type, it is initialized to (positive or unsigned) zero;


static _Decimal64 x;    /* zero with what exponent? */



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