]> git.eshelyaron.com Git - emacs.git/commit
Fix lexing of numbers with trailing decimal point and exponent
authorMattias Engdegård <mattiase@acm.org>
Thu, 20 May 2021 16:26:15 +0000 (18:26 +0200)
committerMattias Engdegård <mattiase@acm.org>
Thu, 27 May 2021 12:16:28 +0000 (14:16 +0200)
commitde45864cf787ce244b0d97e7cf523a6e03743f10
tree903951ab9e9bf58b91e3f591f4a9d80603d112fa
parent40d2970f4360bd942ffc3f86db9ff1499a5a5393
Fix lexing of numbers with trailing decimal point and exponent

Numbers with a trailing dot and an exponent were incorrectly read as
integers (with the exponent ignored) instead of the floats they should
be.  For example, 1.e6 was read as the integer 1, not 1000000.0 as
every sane person would agree was meant. (Bug#48678)

Numbers with a trailing dot but no exponent are still read as
integers.

* src/lread.c (string_to_number): Fix float lexing.
* test/src/lread-tests.el (lread-float): Add test.
* doc/lispref/numbers.texi (Float Basics): Clarify syntax.
doc/lispref/numbers.texi
src/lread.c
test/src/lread-tests.el