in reply to Re^12: NaN output
in thread NaN output

Nothing there that I didn't already know, though the phrase "(erroneous) floating point (NV) values" did catch my eye. I'm wondering why "(erroneous)" is in there.

I've not previously encountered the notion that an infinity is an *erroneous* floating point value. (Or, if I have encountered it, I've not paid due attention to it.)
Did I misconstrue ?

Cheers,
Rob

Replies are listed 'Best First'.
Re^14: NaN output
by BrowserUk (Patriarch) on Mar 07, 2014 at 02:06 UTC
      Ie. A value beyond the capabilities of the binary format to represent. Ie. an erroneousness value.

      Hmmm ... "erroneous" is not a term that I would normally use here. However, it could be handy for some leverage at some stage, so I'll keep it in mind.

      Interestingly, by my reading of Wikipedia, underflow (when the result of a calculation is a smaller number than the computer can actually store in memory) is also an exception in IEEE 754.
      So it, too, pertains to "a value beyond the capabilities of the binary format to represent".

      Maybe we'll see you referring to an "erroneous zero" at some time in the future ;-)

      Cheers,
      Rob
        by my reading of Wikipedia, underflow ... is also an exception in IEEE 754. So it, too, pertains to "a value beyond the capabilities of the binary format to represent".

        Maybe we'll see you referring to an "erroneous zero" at some time in the future ;-)

        Hm. Did you ever see Edward Woodward in The Wicker Man? That was a bigger straw man, but not by much :)

        An "erroneous zero"? No. A value of zero erroneously produced when underflow occurs, yes.

        And if you override the run-time's dubious default setting of 'ignoring floating point exceptions', it can even be detected and handled:

        #define _CRT_SECURE_NO_WARNINGS 1 #include <stdio.h> #include <float.h> #include <excpt.h> int main( int argc, char **argv ) { unsigned int u = _controlfp(0, 0); double x = 0.5e-323, y = 0.5e-323; printf( "x contains: %g before dividing by 2\n", x ); x /= 2; printf( "x now contains: %g\n", x ); u = u & ~_EM_UNDERFLOW; _controlfp(u, _MCW_EM); printf( "\ny contains: %g before dividing by 2\n", y ); __try { y /= 2; } __except( EXCEPTION_EXECUTE_HANDLER ) { printf( "Floating point underflow exception occurred\n"); } printf( "y now contains: %g\n", y ); return 0; }

        So whilst the value zero isn't erroneous; a variable can acquire the value zero erroneously:

        C:\test>intOverflow.exe x contains: 4.94066e-324 before dividing by 2 x now contains: 0 y contains: 4.94066e-324 before dividing by 2 Floating point underflow exception occurred y now contains: 4.94066e-324

        Is this going anywhere?


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.