Thread overview |
---|
May 24, 2008 what does "-nan" mean | ||||
---|---|---|---|---|
| ||||
It does not mean "null" , it does not mean "0" , it does not mean "" so just what does it signify Not a number is cryptic . If it is not a number then just what is it ? |
May 24, 2008 Re: what does "-nan" mean | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tower Ty | Tower Ty wrote:
> It does not mean "null" , it does not mean "0" , it does not mean "" so just what does it signify
>
> Not a number is cryptic . If it is not a number then just what is it ?
It signifies that whatever was assigned to the value was "not a number". That is the program had no idea how to compute or assign a value given the input. Its really a sentinel to indicate error or un-assignment.
-Joel
|
May 24, 2008 Re: what does "-nan" mean | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tower Ty | Tower Ty wrote:
> It does not mean "null" , it does not mean "0" , it does not mean "" so just what does it signify
>
> Not a number is cryptic . If it is not a number then just what is it ?
It's just a special bit pattern that floating point operations can result in when there's no sensible answer to put there. Like when you divide by zero, or do other illegal operations. If you do writefln(0/0.0), it will print 'nan'.
|
May 25, 2008 Re: what does "-nan" mean | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tower Ty | Tower Ty a écrit : > It does not mean "null" , it does not mean "0" , it does not mean "" so just what does it signify > > Not a number is cryptic . If it is not a number then just what is it ? http://en.wikipedia.org/wiki/NaN |
May 25, 2008 Re: what does "-nan" mean | ||||
---|---|---|---|---|
| ||||
Posted in reply to e-t172 | e-t172 Wrote:
> Tower Ty a écrit :
> > It does not mean "null" , it does not mean "0" , it does not mean "" so just what does it signify
> >
> > Not a number is cryptic . If it is not a number then just what is it ?
>
> http://en.wikipedia.org/wiki/NaN
Thanks to you all . If we had a preferred answer system the above link would be the winner .
|
Copyright © 1999-2021 by the D Language Foundation