diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-08-30 20:51:59 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-08-30 20:51:59 (GMT) |
commit | d507dab91f9790a24bd53d41d7fcf52fe89a6eff (patch) | |
tree | bfd040b35180f81cb9b0376df6070d91a08e7c57 /Doc | |
parent | 21922aa9393996b1ea3f324759e158ec623acb43 (diff) | |
download | cpython-d507dab91f9790a24bd53d41d7fcf52fe89a6eff.zip cpython-d507dab91f9790a24bd53d41d7fcf52fe89a6eff.tar.gz cpython-d507dab91f9790a24bd53d41d7fcf52fe89a6eff.tar.bz2 |
SF patch #455966: Allow leading 0 in float/imag literals.
Consequences for Jython still unknown (but raised on Jython-Dev).
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/ref/ref2.tex | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Doc/ref/ref2.tex b/Doc/ref/ref2.tex index 3ccfaef..8b96055 100644 --- a/Doc/ref/ref2.tex +++ b/Doc/ref/ref2.tex @@ -517,26 +517,26 @@ definitions: \production{pointfloat} {[\token{intpart}] \token{fraction} | \token{intpart} "."} \production{exponentfloat} - {(\token{nonzerodigit} \token{digit}* | \token{pointfloat}) + {(\token{intpart} | \token{pointfloat}) \token{exponent}} \production{intpart} - {\token{nonzerodigit} \token{digit}* | "0"} + {\token{digit}+} \production{fraction} {"." \token{digit}+} \production{exponent} {("e" | "E") ["+" | "-"] \token{digit}+} \end{productionlist} -Note that the integer part of a floating point number cannot look like -an octal integer, though the exponent may look like an octal literal -but will always be interpreted using radix 10. For example, -\samp{1e010} is legal, while \samp{07.1} is a syntax error. +Note that the integer and exponent parts of floating point numbers +can look like octal integers, but are interpreted using radix 10. For +example, \samp{077e010} is legal, and denotes the same number +as \samp{77e10}. The allowed range of floating point literals is implementation-dependent. Some examples of floating point literals: \begin{verbatim} -3.14 10. .001 1e100 3.14e-10 +3.14 10. .001 1e100 3.14e-10 0e0 \end{verbatim} Note that numeric literals do not include a sign; a phrase like |