Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: C++ Exercis...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 9526 of 9823
Post > Topic >>

Re: C++ Exercise: Find precision of variable types

by ram@[EMAIL PROTECTED] (Stefan Ram) Apr 21, 2008 at 08:43 PM

"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! ]
 




 4 Posts in Topic:
C++ Exercise: Find precision of variable types
"C++ Newbie" &l  2008-04-21 12:11:24 
Re: C++ Exercise: Find precision of variable types
Thomas Richter <thor@[  2008-04-21 15:39:14 
Re: C++ Exercise: Find precision of variable types
ram@[EMAIL PROTECTED] (S  2008-04-21 20:43:17 
Re: C++ Exercise: Find precision of variable types
"Jeff Baker" &l  2008-04-22 10:53:56 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu Jul 24 1:48:50 CDT 2008.