| Python Language Reference Manual by Guido van Rossum and Fred L. Drake, Jr. Paperback (6"x9"), 120 pages ISBN 0954161785 RRP £12.95 ($19.95) Sales of this book support the Python Software Foundation! Get a printed copy>>> |
2.4.5 Floating point literals
Floating point literals are described by the following lexical definitions:
floatnumberpointfloat|exponentfloatpointfloat [intpart]fraction|intpart"."exponentfloat (intpart|pointfloat)exponentintpartdigit+fraction "."digit+exponent ( "e" | "E" ) [ "+" | "-" ]digit+
Note that the integer and exponent parts of floating point numbers can look like octal integers, but are interpreted using radix 10. For example, ‘077e010’ is legal, and denotes the same number as ‘77e10’. The allowed range of floating point literals is implementation-dependent. Some examples of floating point literals:
3.14 10. .001 1e100 3.14e-10 0e0
Note that floating-point literals do not include a sign; a phrase like
-1.0 is actually an expression composed of the unary operator
- and the literal 1.0.
| ISBN 0954161785 | Python Language Reference Manual | See the print edition |