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

Add example for Quantity #444

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tbenst
Copy link

@tbenst tbenst commented May 13, 2021

Took me a long while to learn about Quantity, so thought I'd attempt a small contribution to make this more obvious.

I'm still not quite sure how to run doctests so hopefully I did that right... ironically a top google result for "julia run doctest" is me, confused, 4 years ago... https://discourse.julialang.org/t/run-doctests/8035

@cstjean
Copy link
Contributor

cstjean commented May 14, 2021

Wouldn't you rather write unknown_quantity * mm?

@tbenst
Copy link
Author

tbenst commented May 14, 2021 via email

@@ -299,3 +299,13 @@ For multiplication and division, note that powers-of-ten prefixes are significan
in unit cancellation. For instance, `mV/V` is not simplified, although `V/V` is.
Also, `N*m/J` is not simplified: there is currently no logic to decide
whether or not units on a dimensionless quantity seem "intentional" or not.

## Adding units to a real number
Untis can be easily added to a real number using the `Quantity` constructor. This may be useful when the value of a unit is not yet known.
Copy link

Choose a reason for hiding this comment

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

Suggested change
Untis can be easily added to a real number using the `Quantity` constructor. This may be useful when the value of a unit is not yet known.
Units can be easily added to a real number using the `Quantity` constructor. This may be useful when the value of a unit is not yet known.

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

Successfully merging this pull request may close these issues.

4 participants