[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Two technical questions on IEEE Std 754-2008



Background:  I am responsible for the architecture of enhancements to ISO/IEC 1989:2002, the COBOL language standard, to make use of five of the interchange formats from IEEE 754-2008 in both encoding/decoding and in arithmetic.  We are preparing a new standard, it has completed its first international ballot, and I have a couple of questions relative to these formats. 
 
Question 1: 
 
I have calculated the maximum magnitudes for decimal64, decimal128, binary32, binary64, and binary64 using what I believe to be equivalent formulae (for clarity of presentation).  I need verification both of the correctness of the formulae (not for calculability using the arithmetic rules of IEEE 754) and the results:  
Decimal formats:  ((10**p - 1) * (10**(emax+1-p)) 
Binary formats:  (2**emax+1) - (2**(emax+1-p)
 
With these formulae, I get
decimal64:  9,999,999,999,999,999 * 10**369, or 9.999999999999999e+384
decimal128:  9,999,999,999,999,999,999,999,999,999,999,999 * 10**6111, or 9.999 999 999 999 999 999 999 999 999 999 999e+6144  
binary32:  (2**128) - (2**104), or 340,282,364,892,697,503,098,207,565,037,516,925,440, or 3.40282364892697503098207565037516925440e+38
binary64:  (2**1024) - (2**981), or approximately 1.797693134862315708145274237317e+308  
binary128:  (2**16384) - (2**16271), or approximately 1.189731495357231765085759326628e+4932
 
Relative to this overall question, I have also calculated the minimum normal and subnormal magnitudes for these five formats, and would like verification as well (not as high priority) :
 
Formula:  b**emin, or b**(1-emax) 
decimal64 normal:  10**(-383), or 1.0e-383
decimal128 normal:  10**(-6143), or 1.0e-6143
binary32 normal:  2**(-126)
binary64 normal:  2**(-1022)
binary128 normal:  2**(-16382) 
 
Formula:  (b**emin) * (b**(1-p)), or (b**(1-emax)) * (b**(1-p)), or b**(1-emax+1-p), or b**(2 - emax - p) 
decimal64 subnormal:  10**(-398), or 1.0e-398  
decimal128 subnormal:  10**(-6176), or 1.0e-6176
binary32 subnormal:  2**(-149) 
binary64 subnormal:  2**(-1074) 
binary128 subnormal:  2**(-16494)     
 
Question 2: 
 
Is there a simple way to determine, by examination of a datum in a decimal interchange format without foreknowledge of the encoding used to produce it, whether it is in the binary encoding or the decimal encoding?  I haven't been able to figure it out with a careful examination of the "combination" field.  Or does a given value in one encoding always have the same bit representation as a cohort with the same exact value in the other encoding?  (I can envision that possibility).
 
Thanks for any input you can provide on these two questions.    
 
Sincerely, 
 
Charles C. Stevens 

754 | revision | FAQ | references | list archive