Open pzrq opened 5 years ago
I may have the expected/actual backwards (or at least needs more data), in an Ubuntu VM:
pzrq@pzrq-VirtualBox:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic
pzrq@pzrq-VirtualBox:~$ python3
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print(pow(0.7071067811865476+0.7071067811865475j, 18446744073709551616))
(0.7531061966369503+0.6578989714135652j)
The bug looks to be here:
https://github.com/beeware/batavia/blob/master/batavia/types/Complex.js#L364
If the exponent is larger than 100, we cast it to a JavaScript 52-bit Number
, so we lose the lower-order bits.
Instead we should just do the exponentiation ourselves.
Expected Behavior
Current Behavior
Steps to reproduce
Your Environment
Python Version (list the specific version number) Python 3.7.3
Operating System and Version (select from the following and list the specific version number; if your OS is not listed, list that as well)