Skip to content

An extension of Unitful.jl for converting between equivalent quantities

License

Notifications You must be signed in to change notification settings

sostock/UnitfulEquivalences.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnitfulEquivalences

PkgEval CI codecov

This package extends the Unitful.jl package to enable conversion between quantities of different dimensions, related by an equivalence (e.g., conversion between mass and energy using the mass–energy equivalence E = mc²). For its usage, see the documentation.

Installation

This package is compatible with Julia ≥ 1.0 and Unitful ≥ 1.0. It can be installed by typing

] add UnitfulEquivalences

in the Julia REPL.

Example usage

julia> using Unitful, UnitfulEquivalences

julia> uconvert(u"keV", 1u"me", MassEnergy()) # electron rest mass equals ≈511 keV
510.9989499961642 keV