Re: NaN's origin

Discussion in 'C++' started by E. Robert Tisdale, Jul 1, 2003.

  1. klaas wrote:

    > How does a NaN occur?
    > Can it occur if a float get's to large?
    > my matrix multiplication algorhytm gives NaN's.
    > There obviously is no 0.0/0.0 statement there.
    > with double used there is no problem... ???



    What Every Scientist Should Know About Floating-Point Arithmetic

    http://docs.sun.com/db/doc/800-7895

    The IEEE Standard, Special Quantities:

    On some floating-point hardware every bit pattern represents a valid
    floating-point number. The IBM System/370 is an example of this. On the
    other hand, the VAX(TM) reserves some bit patterns to represent special
    numbers called reserved operands. This idea goes back to the CDC 6600,
    which had bit patterns for the special quantities INDEFINITE and INFINITY.

    The IEEE standard continues in this tradition and has NaNs and
    infinities (NaN stands for Not a Number). Without any special
    quantities, there is no good way to handle exceptional situations like
    taking the square root of a negative number, other than aborting
    computation. Under IBM System/370 FORTRAN,

    http://docs.sun.com/db/doc/800-7895/6hos0aou9?a=view
     
    E. Robert Tisdale, Jul 1, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nicol Nghia
    Replies:
    0
    Views:
    360
    Nicol Nghia
    Dec 3, 2005
  2. Walter

    Re: NaN's origin

    Walter, Jul 1, 2003, in forum: C++
    Replies:
    0
    Views:
    357
    Walter
    Jul 1, 2003
  3. Frank Schmitt

    Re: NaN's origin

    Frank Schmitt, Jul 7, 2003, in forum: C++
    Replies:
    2
    Views:
    499
    Pete Becker
    Jul 8, 2003
  4. max(NaN,0) should be NaN

    , Aug 28, 2006, in forum: C Programming
    Replies:
    61
    Views:
    1,294
    Michel Hack
    Sep 8, 2006
  5. Replies:
    6
    Views:
    1,590
    Richard Tobin
    Mar 19, 2009
Loading...

Share This Page