Re: Floating Point Precision guidance.

From: Val (valmont_programming_at_hotmail.com)
Date: 11/21/04


Date: Sun, 21 Nov 2004 23:59:09 +0100


"Chris ( Val )" <chrisval@bigpond.com.au> wrote in message news:303ctfF2sqi7vU1@uni-berlin.de...

| You can also check the machine 'epsilon' as follows:
|
| std::cout << std::fixed << std::showpoint << std::setprecision( 20 );
| std::cout << std::numeric_limits<float>::epsilon() << std::endl;
| std::cout << std::numeric_limits<double>::epsilon() << std::endl;
|
| I know that the C++ standard does not guarantee 20 decimal
| places. IIRC, it's about 6 and 15 respectfully for float and
| double, but here is what I get, as an example at 20 DP's:
|
| // float == 0.00000011920928955078
| // double == 0.00000000000000022204

How does this help one in practical coding? What does this all mean?



Relevant Pages

  • Re: WaitForSingleObject() will not deadlock
    ... But what is TSO? ... Technical Standard Order, a minimum performance standard issued by the FAA for certain ... have been more commonly referred to as the "cache coherency" ... A mutex is sufficient to guarantee visibility, ...
    (microsoft.public.vc.mfc)
  • Re: Segfault City
    ... Realizing ... What, if anything, can it be guaranteed will be> '9' in standard C? ... there /isn't/ any guarantee of a character greater than '9' in C. ...
    (comp.lang.c)
  • Re: Segfault City
    ... Andrew Poelstra wrote: ... What, if anything, can it be guaranteed will be> '9' in standard C? ... Perhaps I should have studied English more in high school at East ... there /isn't/ any guarantee of a character greater than '9' in C. ...
    (comp.lang.c)
  • Re: questions on ftell and fopen
    ... foo: ... actually guarantee that a failing fopensets errno. ... A standard is a contract between the implementer and the programmer. ...
    (comp.lang.c)
  • Re: Why GCC does warn me when I using gets() function for accessing file
    ... that on my system int is 17 bits or more, I can guarantee I haven't [invoked ... The C standard says nothing about such ... it actually overruns the buffer. ... to be well defined the spec has to specify something ...
    (comp.lang.c)