![]() |
Shamrock 2025.10.0
Astrophysical Code
|
The table of unit prefixes: a prefix is a dimensionless Unit. More...
#include "shamunits/Unit.hpp"#include "shamunits/details/registry.hpp"#include <string_view>#include <array>Go to the source code of this file.
Namespaces | |
| namespace | shamunits |
| namespace containing the units library | |
Functions | |
| Unit | shamunits::prefix::from_name (std::string_view name) |
| Prefix from its long or short name; throws std::invalid_argument if unknown. | |
Variables | |
| constexpr Unit | shamunits::prefix::tera = scale(1e12) |
| T. | |
| constexpr Unit | shamunits::prefix::giga = scale(1e9) |
| G. | |
| constexpr Unit | shamunits::prefix::mega = scale(1e6) |
| M. | |
| constexpr Unit | shamunits::prefix::kilo = scale(1e3) |
| k | |
| constexpr Unit | shamunits::prefix::hecto = scale(1e2) |
| hect | |
| constexpr Unit | shamunits::prefix::deca = scale(1e1) |
| dec | |
| constexpr Unit | shamunits::prefix::none = scale(1.) |
| no prefix ("None", "_") | |
| constexpr Unit | shamunits::prefix::centi = scale(1e-2) |
| c | |
| constexpr Unit | shamunits::prefix::milli = scale(1e-3) |
| m | |
| constexpr Unit | shamunits::prefix::micro = scale(1e-6) |
| mu | |
| constexpr Unit | shamunits::prefix::nano = scale(1e-9) |
| n | |
| constexpr Unit | shamunits::prefix::pico = scale(1e-12) |
| p | |
| constexpr Unit | shamunits::prefix::femto = scale(1e-15) |
| f | |
| constexpr auto | shamunits::prefix::registry |
| Name registry: Python passes pref="None" by default, so "None" must stay. | |
The table of unit prefixes: a prefix is a dimensionless Unit.
A prefix multiplies a unit once: prefix::mega * units::year is one Myr, and upow(prefix::kilo * units::metre, 2) is one km2.
Definition in file prefix_table.hpp.
|
inline |
Prefix from its long or short name; throws std::invalid_argument if unknown.
Definition at line 62 of file prefix_table.hpp.
|
inlineconstexpr |
c
Definition at line 35 of file prefix_table.hpp.
|
inlineconstexpr |
dec
Definition at line 33 of file prefix_table.hpp.
|
inlineconstexpr |
f
Definition at line 40 of file prefix_table.hpp.
|
inlineconstexpr |
G.
Definition at line 29 of file prefix_table.hpp.
|
inlineconstexpr |
hect
Definition at line 32 of file prefix_table.hpp.
|
inlineconstexpr |
k
Definition at line 31 of file prefix_table.hpp.
|
inlineconstexpr |
M.
Definition at line 30 of file prefix_table.hpp.
|
inlineconstexpr |
mu
Definition at line 37 of file prefix_table.hpp.
|
inlineconstexpr |
m
Definition at line 36 of file prefix_table.hpp.
|
inlineconstexpr |
n
Definition at line 38 of file prefix_table.hpp.
|
inlineconstexpr |
no prefix ("None", "_")
Definition at line 34 of file prefix_table.hpp.
|
inlineconstexpr |
p
Definition at line 39 of file prefix_table.hpp.
|
inlineconstexpr |
Name registry: Python passes pref="None" by default, so "None" must stay.
Definition at line 43 of file prefix_table.hpp.
|
inlineconstexpr |
T.
Definition at line 28 of file prefix_table.hpp.