← index #11667Issue #1847
Related · high · value 2.504
QUERY · ISSUE

ViperTypeError: div/mod not implemented for uint

openby massimosalaopened 2023-05-30updated 2024-09-04
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: ViperTypeError: can't do binary op between 'uint' and 'uint'

closedby peterhinchopened 2016-02-15updated 2020-06-26

The following produces the above error at compile time (only with uints - compiles and runs with int)

@micropython.viper
def foo(arg1: uint, arg2: uint) -> uint:
    return arg1 + arg2

MicroPython v1.6-35-ge372e83 on 2016-02-11; PYBv1.0 with STM32F405RG

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied