Re: NaN's origin

Discussion in 'C++' started by Walter, Jul 1, 2003.

  1. Walter

    Walter Guest

    "klaas" <> wrote in message
    news:_c4Ma.1514$w3.392071@zonnet-reader-1...
    > How does a NaN occur?


    Perform an invalid operation, such as sqrt(-1).

    > Can it occur if a float get's to large?


    No, that will produced an infinity.

    > my matrix multiplication algorhytm gives NaN's.
    > There obviously is no 0.0/0.0 statement there.
    > with double used there is no problem... ???


    Perhaps you're getting an underflow which results in 0, and then dividing by
    that 0.

    -Walter
    www.digitalmars.com free C/C++/D compilers
     
    Walter, 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:
    358
    Nicol Nghia
    Dec 3, 2005
  2. E. Robert Tisdale

    Re: NaN's origin

    E. Robert Tisdale, Jul 1, 2003, in forum: C++
    Replies:
    0
    Views:
    432
    E. Robert Tisdale
    Jul 1, 2003
  3. Frank Schmitt

    Re: NaN's origin

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

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

Share This Page