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

Make hypot dimensionally aware and add tests #27899

Merged
merged 2 commits into from
Jul 2, 2018

Conversation

ajkeller34
Copy link
Contributor

I noticed hypot could be made more generic. Cross-ref PainterQubits/Unitful.jl#143. I added some tests in the style of those found in test/arrayops.jl.

test/math.jl Outdated
import Base: abs, isless, isinf, oneunit, /, *
using Test

struct MeterUnits{T} <: Number
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I didn't realize that existed. It would seem that at various places in the test suite, MeterUnits, PhysQuantity, and Furlong are defined. A separate PR could possibly consolidate all that.

I've followed what was done here to use TestHelpers in test/math.jl. I hope that's correct.

@JeffBezanson JeffBezanson merged commit 051056b into JuliaLang:master Jul 2, 2018
@ajkeller34 ajkeller34 deleted the hypot branch July 2, 2018 22:50
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 this pull request may close these issues.

4 participants