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

Way to convert mass to Mev/c^2 #67

Closed
djsegal opened this issue Mar 26, 2017 · 4 comments
Closed

Way to convert mass to Mev/c^2 #67

djsegal opened this issue Mar 26, 2017 · 4 comments

Comments

@djsegal
Copy link

djsegal commented Mar 26, 2017

The docs don't specify a way to add a new conversion of this variety

@ajkeller34
Copy link
Collaborator

In the new release (v0.2.0), c is now a unit, to permit converting mass into MeV/c^2, for example. c0 is still a quantity equal to the speed of light in vacuum, in units of m/s.

@djsegal
Copy link
Author

djsegal commented Mar 27, 2017

Could you post an example syntax?

@ajkeller34
Copy link
Collaborator

Use either of:

julia> uconvert(u"meV/c^2", 1.0u"kg")
5.6095886500206866e38 c^-2 meV
julia> 1.0u"kg" |> u"meV/c^2"
5.6095886500206866e38 c^-2 meV

@ajkeller34
Copy link
Collaborator

(you may need to Pkg.update())

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

No branches or pull requests

2 participants