mirror of
https://github.com/micropython/micropython.git
synced 2025-09-05 17:30:41 +02:00
Unary minus is being developed in version 1.23
@@ -234,6 +234,7 @@ A viper ```int``` is not an object, and thus does not support methods such as ``
|
||||
|
||||
The \*\* operator (exponentiation, `__pow__`) is not implemented for viper ```int```.
|
||||
|
||||
In versions MicroPython 1.22 and prior, unary minus is not implemented, instead of `x=-a` use `x=0-a`. In version 1.23 the unary minus is being implemented, but not completely yet.
|
||||
|
||||
Be aware: Do not use shift left or right with a negative value, i.e. `x<<(-1)` or `x>>(-1)` should not be used because the result is undefined. This mirrors the C language definition for shifting. Unlike regular MicroPython, there is no check (no exception raised) for negative shift amounts.
|
||||
|
||||
|
Reference in New Issue
Block a user