Skip to content

Commit

Permalink
chore: Correct result
Browse files Browse the repository at this point in the history
  • Loading branch information
spotandjake committed Feb 19, 2024
1 parent 36943de commit 1d48b81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions compiler/test/stdlib/number.test.gr
Expand Up @@ -864,6 +864,8 @@ assert Number.atan2(0.615702673197924044, 2.01190257903248026) ==
0.2969797400449351
assert Number.atan2(-0.558758682360915193, 0.0322398306026380407) ==
-1.51316120533039156
assert Number.atan2(1, 0) == Number.pi / 2
assert Number.atan2(-1, 0) == Number.pi / -2
assert Number.atan2(0, 0) == 0
assert Number.atan2(0, -1) == Number.pi
assert Number.atan2(0, -Infinity) == Number.pi
Expand Down
4 changes: 2 additions & 2 deletions stdlib/number.gr
Expand Up @@ -883,9 +883,9 @@ provide let atan2 = (y, x) => {
} else if (x < 0 && y < 0) {
atan(y / x) - pi
} else if (x == 0 && y > 0) {
2 / pi
pi / 2
} else if (x == 0 && y < 0) {
-2 / pi
pi / -2
} else { // x == 0 && y == 0
0
}
Expand Down

0 comments on commit 1d48b81

Please sign in to comment.