HaxeFoundation / HaxeFoundation/haxe
[python] Int32 wrong result for shift left operations
Open
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
The following code give wrong result ( -4294967296 ) when the target is Python.
The correct value should be 1
```haxe
var changeBit = 31;
var result:Int32 = -2147483648 ^ (1 << changeBit);
trace("result: "+result);
```
If replace the above code with the following one, everything works:
```haxe
var result:Int32 = -2147483648 ^ (1 << 31);
trace("result: "+result);
```
Tested with :
Haxe: 4.2.5
Python 3.11.0
Contributor guide
Assessment
This issue has not been assessed yet.