Bend
Bend copied to clipboard
(Request) Power operation for integers
Describe the bug
The expression 2**1 evaluates to 3.
To Reproduce
def main():
return 2**1
Expected behavior This code should return 2
Desktop (please complete the following information):
- OS: Mac OS 14.4.1
- CPU: M1
- GPU: M1
- Cuda Version: None
The expression 2 ** 1 produces the result of 2 ^ 1 because HVM implements exponentiation only for floating point numbers at the moment. We have a table of the supported operations here.
Is there a plan to make invalid operations like these produce compile time errors?
Yes, once we add a type system