in Search
     
Latest post 05-14-2007 10:08 PM by keithrull. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-12-2007 11:33 PM

    • Bakeri
    • Top 100 Contributor
    • Joined on 03-13-2006
    • Makati
    • Posts 13
    • Points 275
    Could any
    Airsoft is my hobby...... Programming is my source of income!
    • Post Points: 20
  • 05-14-2007 5:38 AM In reply to

    • jokiz
    • Top 10 Contributor
    • Joined on 08-10-2005
    • Singapore
    • Posts 1,098
    • Points 18,030

    Re: NaN

    what? 

    • Post Points: 20
  • 05-14-2007 8:07 PM In reply to

    • cruizer
    • Top 10 Contributor
    • Joined on 12-14-2005
    • Singapore
    • Posts 944
    • Points 22,590

    Re: NaN

    ...? Stick out tongue
    http://devpinoy.org/blogs/cruizer
    Naglalayong buksan at palayain ang kamalayan ng Pinoy .NET developer
    • Post Points: 20
  • 05-14-2007 10:08 PM In reply to

    • keithrull
    • Top 10 Contributor
    • Joined on 08-08-2005
    • San Diego, CA
    • Posts 1,956
    • Points 39,255

    Re: NaN

    NaN = Not A Number

    Not A Number

    "NaN" stands for "not a number". "Nan" is produced if a floating point operation has some input parameters that cause the operation to produce some undefined result. For example, 0.0 divided by 0.0 is arithmetically undefined. Taking the square root of a negative number is also undefined.

    0.0 / 0.0   ->  NaN
    Math.sqrt(-2.0)  ->  NaN
    

    Operations involving NaN

    Double.NaN + Double.NaN  ->  NaN
    Float.NaN + 2.0  ->  NaN
    Float.NaN * 3.0  ->  NaN
    (0.0 / 0.0) * Float.POSITIVE_INFINITY  ->  NaN
    Math.abs(0.0 / 0.0) -> NaN
    (int) (Double.NaN) -> 0
    

    All boolean operations involving "NaN" results in a false value.

    Double.NaN > 1.0  ->  false
    Double.NaN < 1.0  ->  false
    Double.NaN == 1.0  ->  false
    Float.NaN < -3.0  ->  false
    Float.NaN > Float.POSITIVE_INFINITY  ->  false
    Float.NaN < Float.POSITIVE_INFINITY  ->  false
    (0.0 / 0.0) == (0.0 / 0.0)  ->  false
    Taken from http://www.concentric.net/~Ttwang/tech/javafloat.htm
    

    devpinoy sig

    Filed under: , ,
    • Post Points: 5
Page 1 of 1 (4 items)