Does any SQL database actually implement IEEE 754 for floats? MySQL can't represent NaN or Infinity, SQLite can't represent NaN (and has no way to specify Infinity as a literal, but will coerce 9e999), and PG returns true for `'NaN'::float = 'NaN'::float`
-
Show this thread
-
NaN being equal to itself in PG probably isn't a huge deal (though it is quite surprising). Not supporting NaN or Infinity at all seems more likely to cause issues, but even then it's still niche. But not implementing floating point types to spec seems like such a weird omission
3 replies 0 retweets 2 likesShow this thread
MySQL's behavior here is especially weird. It absolutely implements IEEE 754 under the hood, including NaN not equaling itself. But you cannot insert NaN, Infinity, or -Infinity into a table, nor is there a literal form. So you can only observe this with bind params.
1:24 PM - 10 Jan 2020
0 replies
0 retweets
3 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.