13 namespace duds {
namespace data {
16 int v = general::SignExtend<4>(e);
21 u = (
u & 0xFFFFFFF0) | v;
25 int v = general::SignExtend<4>(e);
30 u = (
u & 0xFFFFFF0F) | (v << 4);
34 int v = general::SignExtend<4>(e);
39 u = (
u & 0xFFFFF0FF) | (v << 8);
43 int v = general::SignExtend<4>(e);
48 u = (
u & 0xFFFF0FFF) | (v << 12);
52 int v = general::SignExtend<4>(e);
57 u = (
u & 0xFFF0FFFF) | (v << 16);
61 int v = general::SignExtend<4>(e);
66 u = (
u & 0xFF0FFFFF) | (v << 20);
70 int v = general::SignExtend<4>(e);
75 u = (
u & 0xF0FFFFFF) | (v << 24);
79 int v = general::SignExtend<2>(e);
84 u = (
u & 0xCFFFFFFF) | (v << 28);
88 int v = general::SignExtend<2>(e);
93 u = (
u & 0x3FFFFFFF) | (v << 30);
Indicates that a value is beyond the range allowed by the Unit or ExtendedUnit class.
int cd() const
Returns the exponent for the candela (luminous intensity) dimension.
int ampere() const
Returns the exponent for the ampere (current) dimension.
int m() const
Returns the exponent for the meter (distance) dimension.
int rad() const
Returns the exponent for radians (angle).
const Unit operator*(const Unit &U) const
Combines two units into a new unit.
int second() const
Returns the exponent for the second (time) dimension.
void setSteradian(int e)
Sets the exponent for steradians (solid angle).
int kilogram() const
Returns the exponent for the kilogram (mass) dimension.
int steradian() const
Returns the exponent for steradians (solid angle).
int sr() const
Returns the exponent for steradians (solid angle).
void setKilogram(int e)
Sets the exponent for the kilogram (mass) dimension.
void setSecond(int e)
Sets the exponent for the second (time) dimension.
int radian() const
Returns the exponent for radians (angle).
std::int32_t value() const
Returns the internal exponent fields.
int meter() const
Returns the exponent for the meter (distance) dimension.
int mol() const
Returns the exponent for the mole (amount of substance) dimension.
int K() const
Returns the exponent for the kelvin (thermodynamic temperature) dimension.
void setAmpere(int e)
Sets the exponent for the ampere (current) dimension.
Unit & operator/=(const Unit &U)
Combines two units into a new unit.
void setKelvin(int e)
Sets the exponent for the kelvin (thermodynamic temperature) dimension.
Unit()=default
Construct the same as a std::int32_t; expect the value to be uninitalized.
int kg() const
Returns the exponent for the kilogram (mass) dimension.
Represents an SI unit, either base or derived.
boost::error_info< struct Info_unitname, std::string > BadUnit
The name of the bad unit.
void setMeter(int e)
Sets the exponent for the meter (distance) dimension.
boost::error_info< struct Info_unitexp, int > BadUnitExponent
The out-of-range exponent.
int kelvin() const
Returns the exponent for the kelvin (thermodynamic temperature) dimension.
int mole() const
Returns the exponent for the mole (amount of substance) dimension.
int A() const
Returns the exponent for the ampere (current) dimension.
int candela() const
Returns the exponent for the candela (luminous intensity) dimension.
void setMole(int e)
Sets the exponent for the mole (amount of substance) dimension.
Unit & operator*=(const Unit &U)
Combines two units into a new unit.
std::int32_t u
Stores the exponent fields.
int s() const
Returns the exponent for the second (time) dimension.
void setRadian(int e)
Sets the exponent for radians (angle).
#define DUDS_THROW_EXCEPTION(x)
Works like BOOST_THROW_EXCEPTION, but includes a stack trace if DUDS_ERRORS_VERBOSE is defined...
void setCandela(int e)
Sets the exponent for the candela (luminous intensity) dimension.
const Unit operator/(const Unit &U) const
Combines two units into a new unit.