-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR gives BigInt exponentiation the same edge-case behavior as other integer exponentiation. The normal integer exponentiation checks if `x` is `1` or `-1` before erroring if the power is negative. https://github.com/JuliaLang/julia/blob/9f9e989f241fad1ae03c3920c20a93d8017a5b8f/base/intfuncs.jl#L283-L287 With this PR `big(1)^big(-1) == 1`, `big(-1)^big(-1) == -1` and `big(-1)^big(-2) == 1` --------- Co-authored-by: Sukera <[email protected]>
- Loading branch information
1 parent
eb4416b
commit 3838dab
Showing
2 changed files
with
21 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters