-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: more tail recursion when finding Mersenne primes (#16168)
Previously the failure at `(mersenne 9689).Prime` was a stack overflow in a `norm_num` helper function. Making the relevant function tail-recursive solves that. We now fail with `(kernel) deep recursion detected`, at an apparently system dependent step: * in CI, we still fail at `mersenne 9689` (just with a different error) * on my machine we now succeed at `9689` and `9941`, then fail at `11213`.
- Loading branch information
Showing
2 changed files
with
67 additions
and
15 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