I just bought a copy of SQL:2016-2, and it says nothing about Infinity and NaN (or sNaN) for DECFLOAT (nor does it for double or float for that matter).

I wonder if that means those values are not allowed and should instead raise an exception when inserted, or the result of a calculation.

Mark

On 6-1-2018 17:30, Mark Rotteveel wrote:
If you have a decfloat column with a NaN (or sNaN) value, then selects with a condition on that column will fail with the error below during fetch.

====
*** IBPP::SQLException ***
Context: Statement::Fetch
Message: isc_dsql_fetch failed.

SQL Message : -901
Unsuccessful execution caused by system error that does not preclude successful execution of subsequent statements

Engine Code    : 335545141
Engine Message :
Decimal float invalid operation.  An indeterminant error occurred during an operation.
====

I would suggest that instead comparison with a NaN (or sNaN) would always be false (even if the value compared to is NaN!), as is the case in most programming languages when comparing double NaN.

And similar to NULL, checking for NaN would require something like IS NaN (or maybe a ISNAN(..)). The only question is do we need to discern between +/- NaN and +/- sNaN in these cases?

What do you think?



--
Mark Rotteveel

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to