4 ms·
Today I learned: SELECT 1 / 0 AS var_name; yields a double with value infinite. Which is SQL spec. Must be fun times to actually use that :-)
by BurnGpuBurn 2y ago
Today I learned:
SELECT 1 / 0 AS var_name;
yields a double with value infinite. Which is SQL spec. Must be fun times to actually use that :-)
- ok123456 2y agoIEEE 754 defines the result of divisions and multiplications involving NaN and Inf, which are used extensively in graphics programming. For example, 'select 1.0/(1.0/0.0)' becomes 0.0 again. This allows for inf/nans to be canceled out instead of having to do error checking and exception handling every time one crops up.