Skip to content

Commit

Permalink
feat: iec::var unit added
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Sep 20, 2024
1 parent e92178a commit 7a83c2b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/systems/include/mp-units/systems/iec/unit_symbols.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
MP_UNITS_EXPORT
namespace mp_units::iec::unit_symbols {

// Electromagnetism
inline constexpr auto var = volt_ampere_reactive_power;

// Information science and technology
// bit
inline constexpr auto kbit = si::kilo<bit>;
inline constexpr auto Mbit = si::mega<bit>;
Expand Down
5 changes: 5 additions & 0 deletions src/systems/include/mp-units/systems/iec/units.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <mp-units/bits/module_macros.h>
#include <mp-units/systems/iec/quantities.h>
#include <mp-units/systems/isq/electromagnetism.h>
#include <mp-units/systems/si/units.h>

#ifndef MP_UNITS_IN_MODULE_INTERFACE
Expand All @@ -34,6 +35,10 @@ MP_UNITS_EXPORT
namespace mp_units::iec {

// clang-format off
// Electromagnetism
inline constexpr struct volt_ampere_reactive_power final : named_unit<"var", si::volt * si::ampere, kind_of<isq::reactive_power>> {} volt_ampere_reactive_power;

// Information science and technology
inline constexpr struct erlang final : named_unit<"E", kind_of<traffic_intensity>> {} erlang;
inline constexpr struct bit final : named_unit<"bit", one, kind_of<storage_capacity>> {} bit;
inline constexpr struct octet final : named_unit<"o", mag<8> * bit> {} octet;
Expand Down

0 comments on commit 7a83c2b

Please sign in to comment.