"C++ Newbie" <newbie.cpp@[EMAIL PROTECTED]
> writes:
>In a C++ exercise, I was asked to find the precision of the
>variable types float, double and long double.
The type »float« is not a »variable type«; it is a type.
The meaning of »precision of the type float« is not
given by ISO/IEC 14882:2003(E) - only the relative
order of the precisions of float and double and long double.
According to the float.h header do***entation of C, the
»precision« is »the number of base-b digits in the significand«,
where b is the »base or radix of exponent representation«. But
possibly, this is only as of ISO/IEC 9899:1999 (E).
Otherwise, the cfloat header gives an »epsilon« and
»mantissa digits« for float types, but not a »precision«.
Thus, the utterer of the exercise needs to give his
definition of »precision of a (floating) type« first.
According to ISO/IEC 14882:2003(E), an /ios_base object/
actually /has/ a precision, which is of type streamsize.
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]


|