QUERY · ISSUE
ViperTypeError: div/mod not implemented for uint
enhancement
General topic, not related to a specific micro.
Viper is great for optimizing functions, like custom hashes, that only do calculations on integers... but
ViperTypeError: div/mod not implemented for uint
Is it possible to implement this?
CANDIDATE · ISSUE
Viper throws exception on math operations between uints
py-core
The following fails with ViperTypeError: can't do binary op between 'uint' and 'uint'
@micropython.viper
def foo(x:uint) -> uint:
return x + uint(9) # Every operator I tried failed here
Tested on Pyboard D SF6W. Ref this forum thread.