Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unary operate_to! recurs without bound, until stack overflow #237

Closed
nsajko opened this issue Nov 26, 2023 · 2 comments · Fixed by #245
Closed

unary operate_to! recurs without bound, until stack overflow #237

nsajko opened this issue Nov 26, 2023 · 2 comments · Fixed by #245
Labels
bug Something isn't working

Comments

@nsajko
Copy link
Contributor

nsajko commented Nov 26, 2023

julia> import MutableArithmetics

julia> const MA = MutableArithmetics
MutableArithmetics

julia> MA.operate_to!!(big(1), +, big(1))
ERROR: StackOverflowError:
Stacktrace:
 [1] operate_to!(output::BigInt, op::typeof(+), args::BigInt)
   @ MutableArithmetics ~/.julia/packages/MutableArithmetics/K9YPJ/src/implementations/BigInt.jl:146
 [2] operate_to!(output::BigInt, op::typeof(+), args::BigInt) (repeats 79983 times)
   @ MutableArithmetics ~/.julia/packages/MutableArithmetics/K9YPJ/src/implementations/BigInt.jl:151

julia> MA.operate_to!!(big(1), -, big(1))
ERROR: StackOverflowError:
Stacktrace:
 [1] operate_to!(output::BigInt, op::typeof(-), args::BigInt) (repeats 79984 times)
   @ MutableArithmetics ~/.julia/packages/MutableArithmetics/K9YPJ/src/implementations/BigInt.jl:151
@nsajko nsajko changed the title operate_to! recurs without bound, until stack overflow unary operate_to! recurs without bound, until stack overflow Nov 26, 2023
@odow odow added the bug Something isn't working label Nov 26, 2023
@odow
Copy link
Member

odow commented Nov 26, 2023

This just looks like a bug. I assume we're missing the unary methods.

@nsajko
Copy link
Contributor Author

nsajko commented Nov 26, 2023

Adding them.

@odow odow closed this as completed in #245 Nov 30, 2023
odow pushed a commit that referenced this issue Nov 30, 2023
This is the first time that `abs` is implemented for `BigInt` and
`Rational`.

Fixes #237.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants