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:

Consider the following example:

SELECT CAST('-' AS NUMERIC); -- unexpected: computes 0.0

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

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