From a32a61813ebaecf0c1e69fd1481bf09d8c8b1420 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Tue, 14 Jul 2026 18:08:44 +0200 Subject: Support more floating point literals --- doc/appendix.tex | 5 ++++- doc/language.tex | 12 ++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'doc') diff --git a/doc/appendix.tex b/doc/appendix.tex index 71b0cc4..36bb72a 100644 --- a/doc/appendix.tex +++ b/doc/appendix.tex @@ -35,8 +35,11 @@ \alt{} `0' (`X' | `x') \{\} \alt{} `0' (`B' | `b') \{\}. + = (`e' | `E') [`+' | `-'] \{\}. + = `.\@' \{\} - \alt{} \} `e' [`+' | `-'] \{\}. + [] + \alt{} . = `\textquotesingle' `\textquotesingle'. diff --git a/doc/language.tex b/doc/language.tex index 04f8613..b7b8d9d 100644 --- a/doc/language.tex +++ b/doc/language.tex @@ -51,9 +51,10 @@ preceded by a prefix and followed by a suffix. The prefixes \verb|0x| and indicate binary representation. Unsigned integers have the suffix \verb|u|, signed integers have no suffix. -A \textit{real number} always contains a decimal point. Optionally it may -also contain a decimal scale factor. The letters \verb|e| or \verb|E| is -pronounced as `times ten to the power of'. +A \textit{real number} contains either a decimal point, or a scale factor, +or both. A decimal point must be followed by at least one digit. The letter +\verb|e| (or \verb|E|) introduces the scale factor and is pronounced +``times ten to the power of''. \begin{grammar} = `0' | \{\}. @@ -62,8 +63,11 @@ pronounced as `times ten to the power of'. \alt{} `0' (`X' | `x') \{\} \alt{} `0' (`B' | `b') \{\}. + = (`e' | `E') [`+' | `-'] \{\}. + = `.\@' \{\} - \alt{} \} `e' [`+' | `-'] \{\}. + [] + \alt{} . \end{grammar} Examples: -- cgit v1.2.3