From a3c6ef6d336c03c22e72b326e1dabc11faebfcfb Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sun, 28 Apr 2024 19:12:17 -0400 Subject: [PATCH] xo-unit: + gigatonne unit --- include/xo/unit/basis_unit.hpp | 1 + include/xo/unit/basis_unit_abbrev.hpp | 2 ++ include/xo/unit/natural_unit.hpp | 1 + 3 files changed, 4 insertions(+) diff --git a/include/xo/unit/basis_unit.hpp b/include/xo/unit/basis_unit.hpp index 922470a0..94bdc949 100644 --- a/include/xo/unit/basis_unit.hpp +++ b/include/xo/unit/basis_unit.hpp @@ -64,6 +64,7 @@ namespace xo { constexpr basis_unit tonne = basis_unit(dim::mass, scalefactor_ratio_type( 1000000, 1)); constexpr basis_unit kilotonne = basis_unit(dim::mass, scalefactor_ratio_type( 1000000000, 1)); constexpr basis_unit megatonne = basis_unit(dim::mass, scalefactor_ratio_type(1000000000000, 1)); + constexpr basis_unit gigatonne = basis_unit(dim::mass, scalefactor_ratio_type(1000000000000000, 1)); // ----- distance ----- diff --git a/include/xo/unit/basis_unit_abbrev.hpp b/include/xo/unit/basis_unit_abbrev.hpp index 49216d17..f6e1dfd2 100644 --- a/include/xo/unit/basis_unit_abbrev.hpp +++ b/include/xo/unit/basis_unit_abbrev.hpp @@ -60,6 +60,8 @@ namespace xo { return basis_unit2_abbrev_type::from_chars("kt"); case 1000000000000: return basis_unit2_abbrev_type::from_chars("Mt"); + case 1000000000000000: + return basis_unit2_abbrev_type::from_chars("Gt"); } } diff --git a/include/xo/unit/natural_unit.hpp b/include/xo/unit/natural_unit.hpp index bbd2f249..7617aade 100644 --- a/include/xo/unit/natural_unit.hpp +++ b/include/xo/unit/natural_unit.hpp @@ -368,6 +368,7 @@ namespace xo { constexpr auto tonne = natural_unit::from_bu(bu::tonne); constexpr auto kilotonne = natural_unit::from_bu(bu::kilotonne); constexpr auto megatonne = natural_unit::from_bu(bu::megatonne); + constexpr auto gigatonne = natural_unit::from_bu(bu::gigatonne); constexpr auto picometer = natural_unit::from_bu(bu::picometer); constexpr auto nanometer = natural_unit::from_bu(bu::nanometer);