GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing docs.python.org — 2.4.5 Floating point literals

Previous Page Up One Level Next Page Python Reference Manual Contents Index
Previous: 2.4.4 Integer and long Up: 2.4 Literals Next: 2.4.6 Imaginary literals


2.4.5 Floating point literals

Floating point literals are described by the following lexical definitions:

floatnumber:    pointfloat | exponentfloat
pointfloat:     [intpart] fraction | intpart "."
exponentfloat:  (nonzerodigit digit* | pointfloat) exponent
intpart:        nonzerodigit digit* | "0"
fraction:       "." digit+
exponent:       ("e"|"E") ["+"|"-"] digit+

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, "1e010" is legal, while "07.1" is a syntax error. The allowed range of floating point literals is implementation-dependent. Some examples of floating point literals:

3.14    10.    .001    1e100    3.14e-10

Note that numeric literals do not include a sign; a phrase like -1 is actually an expression composed of the operator - and the literal 1.


Previous Page Up One Level Next Page Python Reference Manual Contents Index
Previous: 2.4.4 Integer and long Up: 2.4 Literals Next: 2.4.6 Imaginary literals

See About this document... for information on suggesting changes.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.