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
I
UniformScaling
Consider the following MWE:
using LinearAlgebra using AlgebraicNumbers A = AlgebraicNumber.([ 1 2 3 4 ]) λ = AlgebraicNumber(2) B = A - λ*I # error here
Error arises:
ERROR: LoadError: MethodError: promote_rule(::Type{Bool}, ::Type{AlgebraicNumber{BigInt, BigFloat}}) is ambiguous. Candidates: promote_rule(x::Type{T}, y::Type{AlgebraicNumber{S, F}}) where {T<:Integer, S, F} @ AlgebraicNumbers ~/.julia/packages/AlgebraicNumbers/H0atE/src/promote.jl:14 promote_rule(::Type{Bool}, ::Type{T}) where T<:Number @ Base bool.jl:4 Possible fix, define promote_rule(::Type{Bool}, ::Type{AlgebraicNumber{S, F}}) where {S, F} Stacktrace: [1] promote_type(#unused#::Type{AlgebraicNumber{BigInt, BigFloat}}, #unused#::Type{Bool}) @ Base ./promotion.jl:307 [2] _promote @ ./promotion.jl:357 [inlined] [3] promote @ ./promotion.jl:381 [inlined] [4] *(x::AlgebraicNumber{BigInt, BigFloat}, y::Bool) @ Base ./promotion.jl:411 [5] *(x::AlgebraicNumber{BigInt, BigFloat}, J::UniformScaling{Bool}) @ LinearAlgebra ~/julia-1.9.3/share/julia/stdlib/v1.9/LinearAlgebra/src/uniformscaling.jl:263 [6] top-level scope @ ~/MSU/Code/Quadrics/bug.jl:12 [7] include(fname::String) @ Base.MainInclude ./client.jl:478 [8] top-level scope @ REPL[14]:1
I expected that I will work just like with, e.g., NiceNumbers:
NiceNumbers
using LinearAlgebra using NiceNumbers A = NiceNumber.([ 1 2 3 4 ]) λ = NiceNumber(2) B = A - λ*I
(the answer is
2×2 Matrix{NiceNumber}: -1 2 3 2
what I've expected)
The text was updated successfully, but these errors were encountered:
Added commit ba3e6fa that fixes this.
Sorry, something went wrong.
No branches or pull requests
Consider the following MWE:
Error arises:
I expected that
I
will work just like with, e.g.,NiceNumbers
:(the answer is
what I've expected)
The text was updated successfully, but these errors were encountered: