[Python-Dev] Rounding float to int directly (Re: struct module and coercing floats to integers)

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Aug 3 08:34:26 CEST 2006


Raymond Hettinger wrote:

> -1 on an extra built-in just to save the time for function call

The time isn't the main issue. The main issue
is that almost all the use cases for round()
involve doing an int() on it afterwards. At
least nobody has put forward an argument to
the contrary yet.

Sure you can define your own function to do
this. But that's still a considerable burden
when you add up the effort over all the
programs that use int(round()).

--
Greg




More information about the Python-Dev mailing list