You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
w600, RP2, others
MicroPython version
latest, e.g.: MicroPython v1.23.0-preview.344.gb1ac266bb on 2024-04-29; Raspberry Pi Pico W with RP2040
Reproduction
@micropython.viperdefvip_unaryminus() ->int:
a=5b=-areturna+bprint(vip_unaryminus()) # -10 <---- error, should be 0@micropython.viperdefvip_tuple_um():
a:int=int(-5)
b=-areturn (a, b)
print(vip_tuple_um()) # (5, 5) <---- error, should be (-5, 5)
Expected behaviour
0 # as 5 and -5 cancel out, so 5 + (-5) = 0
(-5, 5)
Observed behaviour
-10
(5, 5)
Additional Information
No, I've provided everything above.
My interpretation of this errorneaous behaviour is in the issue heading.
Thank you, btw., for improving viper permanently.
The text was updated successfully, but these errors were encountered:
After having a look at 3c445f6 I suspected that unary invert would exhibit the same error and so it does:
@micropython.viperdefvip_invert() ->int:
a=5b=~areturna+bprint(vip_invert()) # -12 <---- error, should be -1@micropython.viperdefvip_tuple_inv():
a:int=int(5)
b=~areturn (a, b)
print(vip_tuple_inv()) # (-6, -6) <---- error, should be (5, -6)
Checks
I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.
I've searched for existing issues matching this bug, and didn't find any.
Port, board and/or hardware
w600, RP2, others
MicroPython version
latest, e.g.: MicroPython v1.23.0-preview.344.gb1ac266bb on 2024-04-29; Raspberry Pi Pico W with RP2040
Reproduction
Expected behaviour
Observed behaviour
-10
(5, 5)
Additional Information
No, I've provided everything above.
My interpretation of this errorneaous behaviour is in the issue heading.
Thank you, btw., for improving viper permanently.
The text was updated successfully, but these errors were encountered: