[Python-Dev] Floor division (original) (raw)
Raymond Hettinger raymond.hettinger at verizon.net
Sat Jan 20 01:28:17 CET 2007
- Previous message: [Python-Dev] BangPycon 2007 - First Indian Python Conference : Call for Participation
- Next message: [Python-Dev] Floor division
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I bumped into an oddity today:
6.0 // 0.001 != math.floor(6.0 / 0.001)
In looking at Objects/floatobject.c, I was surprised to find that float_floor_division() is implemented in terms of float_divmod(). Does anyone know why it takes such a circuitous path? I had expected something simpler and faster:
return PyFloat_FromDouble(floor(a/b));
Raymond
- Previous message: [Python-Dev] BangPycon 2007 - First Indian Python Conference : Call for Participation
- Next message: [Python-Dev] Floor division
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]