[pypy-dev] Bug in lltypesystem

Armin Rigo arigo at tunes.org
Tue Mar 28 11:50:15 CEST 2006


Hi Antonio,

On Thu, Mar 23, 2006 at 10:33:52PM +0100, Antonio Cuni wrote:
> I've just found a bug in lltypesystem; to reproduce type the following 
> in translatorshell.py:
> 
> >>> from __future__ import division
> >>> def bug(x,y):
> ...   return x/y

Thanks.  I've fixed this and cleaned up a bit the div / floordiv /
truediv mess that we have in low-level operations.  Now there is only
'int_floordiv' (and uint_floordiv, llong_floordiv...) for integer types,
and 'float_truediv' for floats.  In the example you give, the RTyper now
introduces conversions from int to float of both x and y before using
'float_truediv'.  (Interestingly, this is done by removing all
references to 'truediv' from IntegerRepr and letting it fall back to its
superclass FloatRepr.)


A bientot,

Armin



More information about the Pypy-dev mailing list