SQLite Forum

document nit chapter 2 section 3 literals
Login
The discussion following the diagram on [numeric-literal](https://sqlite.org/lang_expr.html#litvalue) values is inconsistent with the diagram. So some repair is appropriate.

It is interesting that the scanner does not recognize (or return) negative reals or integers. That is handled, apparently (at first examination, which is enough for this discussion) by the parser. Whether the parser takes care of negative literals or that is done during semantic analysis and optimization is immaterial.

The fact is that the [VDBE](https://sqlite.org/opcode.html) produces identical opcodes when either positive or negative numbers are used.<sup>1</sup> So, for all practical purposes, the library acts **just as if** one can write negative numeric literals. And so it is certainly best (IMO) for the docs to indicate as much. There is no confusion awaiting users that way, and possibly a reduction of confusion for those who take the railroad charts too literally.

----

1. Of course, the constant loaded into a register by the instruction differs, but the opcode is not to be confused with its parameters.