(text/x-fossil-wiki)
Consider the following statement:
<pre>
SELECT -'.'; -- expected: 0, actual: 0.0
</pre>
It seems that the '.' is confused with a floating-point number when used with the unary minus. This is also the case for other arithmetic operators (e.g., see below).
<pre>
SELECT '.' + 0; -- expected: 0, actual: 0.0
</pre>
This is unexpected, since according to [https://www.sqlite.org/syntax/numeric-literal.html], the '.' should be followed by at least one digit to be a valid number.
Previously, this worked as expected and still works as expected when casting '.' to NUMERIC:
<pre>
SELECT -CAST('.' AS NUMERIC); -- 0
</pre>
See [4c2d7639f0], where CAST('-' AS NUMERIC) previously computed 0.0.
|