We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
These probably shouldn't overflow:
julia> rem(1//typemax(Int), 2) ERROR: OverflowError: 9223372036854775807 * 2 overflowed for type Int64 Stacktrace: [1] throw_overflowerr_binaryop(::Symbol, ::Int64, ::Int64) at ./checked.jl:173 [2] checked_mul at ./checked.jl:307 [inlined] [3] rem(::Rational{Int64}, ::Int64) at ./rational.jl:288 [4] top-level scope at REPL[9]:1 julia> div(1//typemax(Int), 2) ERROR: OverflowError: 9223372036854775807 * 2 overflowed for type Int64 Stacktrace: [1] throw_overflowerr_binaryop(::Symbol, ::Int64, ::Int64) at ./checked.jl:173 [2] checked_mul at ./checked.jl:307 [inlined] [3] div(::Rational{Int64}, ::Int64, ::RoundingMode{:ToZero}) at ./rational.jl:407 [4] div(::Rational{Int64}, ::Int64) at ./rational.jl:425 [5] top-level scope at REPL[10]:1
Maybe a it's enough to just check if the first argument is smaller than the second one, and in that case just return the first argument/0.
The text was updated successfully, but these errors were encountered:
The denominator in the div case is too large to be represented. The rem operation could be made to work.
div
rem
Sorry, something went wrong.
div(1//typemax(Int), 2) ist just 0, no?
div(1//typemax(Int), 2)
0
Ah, true. I was thinking (1//typemax(Int))/2 which is not zero, of course. Carry on!
(1//typemax(Int))/2
No branches or pull requests
These probably shouldn't overflow:
Maybe a it's enough to just check if the first argument is smaller than the second one, and in that case just return the first argument/0.
The text was updated successfully, but these errors were encountered: