ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH

Reference
ActivePython 2.5
Python Documentation
Language Reference
2. Lexical analysis
2.4 Literals
2.4.1 String literals
2.4.2 String literal concatenation
2.4.3 Numeric literals
2.4.4 Integer and long integer literals
2.4.5 Floating point literals
2.4.6 Imaginary literals

MyASPN >> Reference >> ActivePython 2.5 >> Python Documentation >> Language Reference >> 2. Lexical analysis >> 2.4 Literals
ActivePython 2.5 documentation


2.4.5 Floating point literals

Floating point literals are described by the following lexical definitions:

Download entire grammar as text.

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 numeric literals do not include a sign; a phrase like -1 is actually an expression composed of the unary operator - and the literal 1.

See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved