Skip to content

Conversation

@oscardssmith
Copy link
Member

fixes #49398

@oscardssmith oscardssmith added the test This change adds or pertains to unit tests label Apr 19, 2023
@oscardssmith
Copy link
Member Author

failing tests were added by #47995

@Seelengrab
Copy link
Contributor

Which of these is the unintended behavior?

julia> div(typemin(Int8), Int8(-1))
ERROR: DivideError: integer division error
Stacktrace:
 [1] div(x::Int8, y::Int8)
   @ Base ./int.jl:295
 [2] top-level scope
   @ REPL[2]:1

julia> div(typemin(Int8), Base.MultiplicativeInverses.multiplicativeinverse(typemin(Int8)))
1

@oscardssmith
Copy link
Member Author

oscardssmith commented Apr 19, 2023

did you mean

julia> div(typemin(Int8), Base.multiplicativeinverse(Int8(-1)))
-128

@Seelengrab
Copy link
Contributor

Ah, yes! My question is whether div on a multiplicativeinverse there should error as well, or whether that explicitly should not error.

@staticfloat staticfloat merged commit 68ed6f7 into JuliaLang:master Apr 27, 2023
@oscardssmith oscardssmith deleted the fix-multiinv-test branch April 27, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test This change adds or pertains to unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

integer division error in tests

3 participants