How MUCH is that suitcase?
-
So, trying to find a suitcase. Find website... This happens.
-
Does that mean naan bread is now legal tender
-
Well, if the price is not a number, that means you have to give them a kidney or something.
-
Well, no suitcase on the list has a price greater than NaN, so where's the problem?
-
Is NaN greater than 44?
-
It's not smaller.
-
I don't care to know JS enough to know what will happen
if (price >= 44 && price <= NaN)
...
-
I don't care to know JS enough to know what will happen
if (price >= 44 && price <= NaN)
...Numbers are both not smaller than and not larger than NaN, so that expression will always be false.
-
That's what I thought...
-
Where'd you get that iPad 34G?
-
NaN op x
, where op is any arithmetic comparison andx
is a variable of any type, is always false.
-
ITYM 4G
-
The Apple Store in Brighton, England sells ones that travelled through time and I have crazy fast 34G wireless.
@ben_lubar is quite correct, of course.
-
It was a bit of a silly name once the other networks had 3G. Now they're all 4G it doesn't make any sense
-
I read that title and thought about this TV program:
-
-
But one based on a TV series.
-
Wrong version.
-
My image search have failed me, but this is the tv program:
And this is our copycat version, licensed from the original:
-
And now your backup is larger.
-
You could argue a good case for an infinite number as not being a number. i.e. if it can be defined as a number then it is not infinite.
Of course, that will create a whole new discussion of what infinity + 1 is.
-
You could argue a good case for an infinite number as not being a number.
IEEE floating point does not agree.
-
IEEE floating point does not agree.
I think you are going to explain that one. In my limited research I couldn't see any connection between it and infinite numbers.
Dealing with it at a logical and symantic level, I would say than anything dealing with floating points would be more related to the finite
-
I think you are going to explain that one. In my limited research I couldn't see any connection between it and infinite numbers.
Easy.
Inf
(or sometimesInfinity
) andNaN
are both IEEE float values, representing respectively positive infinity and the indicator that what you've got is not a number at all. The former comes from an expression like1.0/0.0
, and the latter from something like0.0/0.0
(which is total BS when you try to work out what it means; it doesn't mean anything at all).Let's ask Javascript what it thinks about their equality:
» Infinity == NaN « false
Yep. Not equal.
-
```javascript
» Infinity == NaN
« falseWhile I certainly agree, I'd hardly take **Javascript**'s word for it.
-
Well.... Something fucked up there. Kept getting 500 errors on posting, avatar and notifications did not show - but I could access my profile. Could not even log out - had to delete the cookies.
Anyway, the post I was trying to post....
A perfectly correct (if somewhat pedantic) answer, that really show the limitations of computers in that they can only express a number in terms of the "physical" bits it can occupy.
My mistake was in not saying that my post was in answer to @Arantor's question:
Is NaN greater than 44?
and in support (sort of) of @Maciejasjmj statement:
Well, no suitcase on the list has a price greater than NaN, so where's the problem?
Funnily enough, I was actually thinking that the largest possible number can be defined by the physical space to needed to define it. It is similar to the problem computers have. i.e. if you converted the entire mass of the universe into a strip the width of the smallest thing and the thickness of the smallest thing, it would have a finite length and (if you could find something to write something smaller than the smallest thing) you would have the largest possible number. Unless, of course, you invented a notational system to cope with it: But then you are just delaying the inevitable.
INB4: Yes, id all the matter in the Universe was converted into the "strip", who and what would do the writing, and where would the ink come from?
LOL Tried to post this and got an internal server error - probably NaN featured in that somewhere.
Twice.
Thrice.
And again, gonna wait a bit...Reloaded page....
And still 500
-
500 Internal Server Error
-
Asking javascript as well:
» NaN == NaN « false
I don't disagree with your point but I think your reasoning needs work.
-
» typeof Infinity « 'number'
Of course:
» typeof NaN « 'number'
So... yeah.
-
-
I don't disagree with your point but I think your reasoning needs work.
That
NaN
is not equal to itself is in fact true everywhere that uses IEEE arithmetic, across large numbers of languages, except on (some versions of?) MSVC for raisins.
-
And for languages that don't have NaN, like PHP... ;)
-
Can you cheat your way into it? Perhaps by parsing a binary version of a float from some source. Yes, NaN is noxious, but it's intended to be a poison value for when code Does Something Bad and when throwing an exception immediately is a non-option.
-
PHP's idea of NaN is
0
.
-
-
Were you honestly surprised by this?
I'm still amazed PHP even has
null
but that's probably an accident rather than "by design" because NPEs aren't a thing...
-
-
You were disappoint? Son, this is PHP we're talking about!
-
LINQPad version:
-
-
-
Hardly surprising.
What happens is that your two constants which don't exist get treated as string liberals, and your two string liberals don't match, yielding a
false
value, whose string representation is an empty string (as compared totrue
's string representation which is1
) and your environment swallowed theE_NOTICE
s that were issued.Not saying it's right but that it isn't surprising.
-
string liberals
I'm a string liberal, you can wear a G-string around me anytime you like *wiiink*
-
Fucking iPad auto correct plus staying up late enough to not be jet lagged too bad... Ugh.
-
-
I'm a string liberal, you can wear a G-string around me anytime you like *wiiink*
Meh; not offended, but no *wiiink*. @royal_poet, on the other hand, ... :)
-
-
I am not so sure that's anything anyone would actually want to see. Unless we are talking of photos mending socks. I can rock a needle and string.
-
-
We don't play DF...