On Jan 25, 2008, at 1:22 PM, Raymond Hettinger wrote:
> I wouldn't fret about this too much.  Intrepreting int(f) as
> meaning truncate has a *long* history in *many* programming
> languages.  It is a specious argument int(f) is ambiguous.
> No one thinks it means ceil(f).


Not that I think my opinion will have any weight in this discussion,  
but I'd agree that int has a long history not likely to be  
misinterpreted when applied to real numbers.

Quoting from Graham, Knuth and Patashnik "Concrete Mathematics...2nd  
edition" page 67:

"We start by covering the floor (greatest integer) and ceiling (least  
integer) functions, which are defined for all real x...

...some pocket calculators have an INT function, defined as floor(x)  
when x is positive and ceil(x) when x is negative. The designers of  
these calculators probably wanted their INT function to satisfy the  
identity INT(-X) = -INT(X). But we'll stick to our floor and ceiling  
functions, because they have even nicer properties than this."

jared
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to