From f49cce98b9e3aba664c1b58224aaebfb3c6d1a40 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 4 May 2024 14:52:52 -0400 Subject: [PATCH] xo-unit: + quantity.reciprocal() --- include/xo/unit/quantity.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/xo/unit/quantity.hpp b/include/xo/unit/quantity.hpp index be93f8c7..7b9b804c 100644 --- a/include/xo/unit/quantity.hpp +++ b/include/xo/unit/quantity.hpp @@ -43,7 +43,13 @@ namespace xo { // unit_qty // zero_qty - // reciprocal + + constexpr + auto reciprocal() const { + return quantity(1.0 / scale_); + } template constexpr