[Numpy-discussion] Re: numpy, overflow, inf, ieee, and rich , comparison

"Jürgen A. Erhard" juergen.erhard at gmx.net
Mon Oct 30 23:58:56 EST 2000


>>>>> "Donald" == Donald O'Donnell <donod at home.com> writes:

[...]

    Donald> The rule is very simple and easy to remember: If an
    Donald> expression consists of all integers, the result is an
    Donald> integer; if it contains mixed integers and floats, the
    Donald> integers are promoted to floats, the calculations are done
    Donald> using floats, and the result is a float.

This rule is very simple... and easy to remember... and *wrong*.

What would be the result of

    (2 / 3) * 3

according to this rule?  Well, 2.0 of course.  But in reality it's 0,
as we all know.

For the record, I'm all for 2/3 giving 2/3 (a floating point
approximation thereof, or better yet, a rational)

Bye, J

-- 
Jürgen A. Erhard    juergen.erhard at gmx.net   phone: (GERMANY) 0721 27326
          My WebHome: http://members.tripod.com/Juergen_Erhard
          George Herrimann's Krazy Kat (http://www.krazy.com)
   "No matter how cynical I get, I can't keep up."  -- Bruce Schneier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 248 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20001031/f3afc9f0/attachment.sig>


More information about the Python-list mailing list