robpike / ivy

ivy, an APL-like calculator
Other
1.32k stars 103 forks source link

For A in [-2, 0) and B an even number, A**B returns 1 #108

Closed n-riesco closed 2 years ago

n-riesco commented 2 years ago
$ go version
go version go1.17.7 linux/amd64

$ go install robpike.io/ivy@latest
go: downloading robpike.io/ivy v0.2.6

$ ivy
-0.01 -0.1 -0.2 -0.21 -0.201 -0.3 ** 0
1 1 1 1 1 1

-0.01 -0.1 -0.2 -0.21 -0.201 -0.3 ** 1
-1/100 -1/10 -1/5 -21/100 -201/1000 -3/10

-0.01 -0.1 -0.2 -0.21 -0.201 -0.3 ** 2
1 1 1 441/10000 40401/1000000 9/100

-0.01 -0.1 -0.2 -0.21 -0.201 -0.3 ** 3
-1/100 -1/10 -1/5 -9261/1000000 -8120601/1000000000 -27/1000

-0.01 -0.1 -0.2 -0.21 -0.201 -0.3 ** 4
1 1 1 194481/100000000 1632240801/1000000000000 81/10000

-0.01 -0.1 -0.2 -0.21 -0.201 -0.3 ** 6
1 1 1 85766121/1000000000000 65944160601201/1000000000000000000 729/1000000
robpike commented 2 years ago

I will investigate. It's an old bug.