What uncommon floating-point sizes exist in C++ compilers -


the c++14 draft standard seems rather quiet specific requirements float, double , long double, although these sizes seem common:

  • float: ieee 32 bit floating-point representation (roughly 7 digits of precision, exponent range of 1e-38..1e+38)

  • double: ieee 64 bit floating-point representation (roughly 16 digits of precision, exponent range of 1e-308..1e+308)

  • long double: 80 bit floating-point representation (roughly 19 digits of precision, exponent range of 1e-4951..1e+4932)

what c++ compilers , systems use floating-point sizes other these?

i'm interested in longer, shorter, , non-binary representations using standard types, not libraries, primary interest portability of c++ programs.

first of, new stackoverflow, please bear me.

however, answer question. looking @ floath.h headers, specify floating point parameters the:

  1. intel compiler

    //float: #define flt_max                 3.40282347e+38f  //double: #define dbl_max                 1.7976931348623157e+308  //long double: #if (__imflongdouble == 64) || defined(__longdouble_as_double) #define ldbl_max                    1.7976931348623157e+308l #else #define ldbl_max                1.1897314953572317650213e+4932l 
  2. gcc (mingw gcc 4 or 5)

    //float: #define flt_max         3.40282347e+38f  //double: #define dbl_max     1.7976931348623157e+308  //long double: (same double gcc): #define ldbl_max        1.7976931348623157e+308l 
  3. microsoft

    //float: #define flt_max         3.40282347e+38f  //double: #define dbl_max     1.7976931348623157e+308  //long double: (same double microsoft): #define ldbl_max            dbl_max 

so, can see intel compiler provides 80 bit representation long double on "standard" windows machine.

this data copied respective float.h headers windows machine.


Comments