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

missing copysign(::Number, ::Quantity) #605

Closed
stevengj opened this issue Jan 17, 2023 · 0 comments · Fixed by #612
Closed

missing copysign(::Number, ::Quantity) #605

stevengj opened this issue Jan 17, 2023 · 0 comments · Fixed by #612

Comments

@stevengj
Copy link

stevengj commented Jan 17, 2023

This is an missing method that I encountered while trying to fix JuliaMath/QuadGK.jl#64 (#597 (comment)):

julia> copysign(4u"m", 3)
4 m

julia> copysign(3, 4u"m")
ERROR: MethodError: no method matching copysign(::Int64, ::Quantity{Int64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}})

I don't see any logical reason to omit this, since the sign of a unitful quantity is well-defined, and indeed you have signbit(::Quantity) already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant