You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>zero(Quantity{Int64, D, U} where U where D)
0
This happens via a fallback to
julia>convert(Quantity{Int64, D, U} where U where D, 0)
0
The convert behavior makes sense, since it returns a representation of 0 of type Quantity{Int64, D, U} where U where D. But I'm not sure what it means to return the zero element of a quantity whose units are not specified.
I came to this conclusion via JuliaLang/julia#33099 which, in my opinion, erroneously succeeds and should have instead failed under the fallback for zero.
The text was updated successfully, but these errors were encountered:
ajkeller34
pushed a commit
to rigetti/Unitful.jl
that referenced
this issue
Sep 1, 2019
… specified. ClosesPainterQubits#264.
- `zero(::Type{<:AbstractQuantity{T}}) where T` should fail.
- `zero(::Type{<:AbstractQuantity{T,D}}) where {T,D}` should use `upreferred(D)`.
This happens via a fallback to
The
convert
behavior makes sense, since it returns a representation of0
of typeQuantity{Int64, D, U} where U where D
. But I'm not sure what it means to return the zero element of a quantity whose units are not specified.I came to this conclusion via JuliaLang/julia#33099 which, in my opinion, erroneously succeeds and should have instead failed under the fallback for
zero
.The text was updated successfully, but these errors were encountered: