UnitfulEquivalences.jl

An extension of Unitful.jl for converting between equivalent quantities
Author sostock
Popularity
5 Stars
Updated Last
8 Months Ago
Started In
October 2020

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