I know I could just google this, but it's more fun to ask you fine folks.
Does anyone know why the string " NaN " with that particular casing, is the string value that is meant to be used in so many systems (like GeoJSON) to denote a null value?
Why not NuLL or -null-? what exactly does NaN stand for?
"Null and Null"?
Sorry, that probably wasn't as much fun as you hoped.😜
But anyway, lots of values can be non-null, but still not a number. Strings, like "Dobo," or objects, for example.
Fun (but really unrelated) fact: when I worked at SAS writing C code, if you allocated memory on the development system it would be automatically initialized with the hex value DEADBEEF over and over again.
So when you were debugging you could see you were referencing memory that had never had anything stored in it because it would dump out as DEADBEEFDEADBEEFDEADBEEF....
I don't know about that, I guess it depends on the language interpreter you're using what kind of complaint it makes. I've seen it in a context where you try to do something mathematical with a variable that doesn't contain a number. Could be null, could be undefined, could be something meaningful in a non mathematical context.
@XSGeek Not a number.
@XSGeek - because null is null, 9 is a number, positive or negative infinity is a number, "foobar" is Not a Number, {some: "object"} is Not a Number.
(casing because articles don't get capitalized?)
@XSGeek - null is both null and Not a number. It's also not a string, and not equal to null (sometimes, but that's a hotly debated topic best left to mathematicians who've never coded). Null /is/ null, but you can't add 9 to a null, except when some languages allow it, but other times you can add null to 9, but not always because other languages don't allow that, but quite often you can add null to "9", and some languages will terminate it there, others will throw an error and... and... and...
@XSGeek - yeah... it's just one of those things... like learning that 1+1.0 = 2.00000000000003.
@XSGeek - this is the infamous pentium bug, isn't it?
@XSGeek - wow... ok, even more arcane. I give you full props for figuring that one out.
At SAS I supported a big hunk o'code that was called the region manager. It was responsible for capturing events within a rectangle of the GUI and passing them to the correct objects, persisting object location, and so on.
I got handed a bug where one of our devs would see the regions on his screen marching down and to the right when he closed a session and reopened it. One pixel each time he ended and restarted.
1/2
@0x56
But only after about a week of working on a given screen layout. Up to that point, no problem.
No one else ever saw the problem.
Every now and then he'd call me down to his office and show me the behavior, but I was never able to track it down.
That bug report stayed open for my whole 5 years of maintaining the RM.
@0x56
@XSGeek
Not a Number