Convert '165.0' to int

Prasad, Ramit ramit.prasad at jpmorgan.com
Tue Aug 2 02:42:05 CEST 2011


-----Original Message-----
From: python-list-bounces+ramit.prasad=jpmchase.com at python.org [mailto:python-list-bounces+ramit.prasad=jpmchase.com at python.org] On Behalf Of Frank Millman
Sent: Monday, July 25, 2011 12:51 AM
To: python-list at python.org
Subject: Re: Convert '165.0' to int

On Jul 25, 2:04 am, Gregory Ewing <greg.ew... at canterbury.ac.nz> wrote:
> Frank Millman wrote:
> > I know I am flogging a dead horse here, but IMHO, '165', '165.',
> > '165.0', and '165.00' are all valid string representations of the
> > integer 165.[1]
>
> > Therefore, for practical purposes, it would not be wrong for python's
> > 'int' function to accept these without complaining.
>
> How far would you go with that? Would you also accept
> '1.65e2' as a valid representation of the integer 165?
>

To be honest, I don't even know what that means! I could read up on
it, but I think this has gone far enough. Having flogged this horse to
death, I will now let it rest in peace :-)

Frank
-- 
http://mail.python.org/mailman/listinfo/python-list


========================

'1.65e2' is a fairly standard representation of scientific notation. It basically translates to: 1.65 x 10^2

For more details, see: http://en.wikipedia.org/wiki/Scientific_notation 

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423



This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  



More information about the Python-list mailing list