I don't know much about RPython internals, but PyPy calls rpython.rtyper.lltypesystem.module.ll_math.math_fmod for modulus operations on floats.
On Fri, Mar 27, 2015 at 5:46 PM, Timothy Baldridge <[email protected]> wrote: > I have some RPython that does this: > > return a % b > > while in another function I'm calling the same, but the two functions > differ in the types of a and b (mix of ints and floats). > > However, during translation I'm getting a blocked block exception. > > translation:ERROR] AnnotatorError: > [translation:ERROR] > [translation:ERROR] Blocked block -- operation cannot succeed > [translation:ERROR] > [translation:ERROR] v12 = mod(v10, v11) > [translation:ERROR] > [translation:ERROR] In <FunctionGraph of > (pixie.vm.numbers:1)_rem_Float_Integer at 0x105b80490>: > [translation:ERROR] no source! > [translation:ERROR] Known variable annotations: > [translation:ERROR] v10 = SomeFloat() > [translation:ERROR] v11 = SomeInteger(knowntype=int, nonneg=False, > unsigned=False) > [translation:ERROR] > [translation:ERROR] Blocked block -- operation cannot succeed > [translation:ERROR] > [translation:ERROR] v15 = mod(v13, v14) > [translation:ERROR] > [translation:ERROR] In <FunctionGraph of > (pixie.vm.numbers:1)_rem_Integer_Float at 0x1059ac550>: > [translation:ERROR] no source! > [translation:ERROR] Known variable annotations: > [translation:ERROR] v13 = SomeInteger(knowntype=int, nonneg=False, > unsigned=False) > [translation:ERROR] v14 = SomeFloat() > [translation:ERROR] > [translation:ERROR] Blocked block -- operation cannot succeed > [translation:ERROR] > [translation:ERROR] v18 = mod(v16, v17) > [translation:ERROR] > [translation:ERROR] In <FunctionGraph of > (pixie.vm.numbers:1)_rem_Float_Float at 0x10544a650>: > [translation:ERROR] no source! > [translation:ERROR] Known variable annotations: > [translation:ERROR] v16 = SomeFloat() > [translation:ERROR] v17 = SomeFloat() > [translation:ERROR] > > > Do we need another entry in rtyper? Looking at rtyper/rfloat.py I see > entries on how to type add, sub, etc, but nothing for mod. > > Thanks, > > Timothy > > _______________________________________________ > pypy-dev mailing list > [email protected] > https://mail.python.org/mailman/listinfo/pypy-dev > > -- Ryan [ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong. http://kirbyfan64.github.io/
_______________________________________________ pypy-dev mailing list [email protected] https://mail.python.org/mailman/listinfo/pypy-dev
