SQLite

View Ticket
Login
Ticket Hash: 4c2d7639f076aa7cc9797650db60a6be5b6d2e4b
Title: CAST('-' AS NUMERIC) computes 0.0
Status: Fixed Type: Code_Defect
Severity: Minor Priority: Immediate
Subsystem: Unknown Resolution: Fixed
Last Modified: 2019-06-07 22:26:55
Version Found In:
User Comments:
mrigger added on 2019-05-25 10:06:10: (text/x-fossil-wiki)
Consider the following example:

<pre>
SELECT CAST('-' AS NUMERIC); -- unexpected: computes 0.0
</pre>

I would expect that 0 is computed by the expression, as, for example, in the expressions below:

<pre>
SELECT CAST('-0' AS NUMERIC); -- 0
SELECT CAST('+' AS NUMERIC); -- 0
SELECT CAST('/' AS NUMERIC); -- 0
</pre>