sostock / UnitfulEquivalences.jl

An extension of Unitful.jl for converting between equivalent quantities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

An extension of Unitful.jl for converting between equivalent quantities

License:Other


Languages

Language:Julia 100.0%