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

Issue with BigInt <: Signed #24298

Closed
omus opened this issue Oct 23, 2017 · 0 comments
Closed

Issue with BigInt <: Signed #24298

omus opened this issue Oct 23, 2017 · 0 comments
Labels
domain:bignums BigInt and BigFloat kind:regression Regression in behavior compared to a previous version

Comments

@omus
Copy link
Member

omus commented Oct 23, 2017

Changing BigInt to be a subtypes of Signed can cause issues when promotion is skipped. For example:

Julia 0.6.0

julia> mod(BigInt(6), UInt128(5))  # Calls `mod(::Real, ::Real)`
1

Julia 0.7.0-DEV.2280 (d3afdfd)

julia> mod(BigInt(6), UInt128(5))  # Calls `mod(::Signed, ::Unsigned)`
ERROR: MethodError: Cannot `convert` an object of type BigInt to an object of type Unsigned
This may have arisen from a call to the constructor Unsigned(...),
since type constructors fall back to convert methods.
Stacktrace:
 [1] unsigned(::BigInt) at ./int.jl:148
 [2] mod(::BigInt, ::UInt128) at ./int.jl:210
@omus omus added domain:bignums BigInt and BigFloat kind:regression Regression in behavior compared to a previous version labels Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:bignums BigInt and BigFloat kind:regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

1 participant