From f900c43463457be25aa06704f56706d2562068de Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 1 May 2024 08:42:22 -0500 Subject: [PATCH] xo-pyunit: + division --- src/pyunit/pyunit.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/pyunit/pyunit.cpp b/src/pyunit/pyunit.cpp index 9384e308..41b38077 100644 --- a/src/pyunit/pyunit.cpp +++ b/src/pyunit/pyunit.cpp @@ -63,6 +63,23 @@ namespace xo { { return x * y; }) + + .def("__truediv__", + [](const XoQuantity & x, const XoQuantity & y) + { + return x / y; + }) + .def("__truediv__", + [](const XoQuantity & x, double y) + { + return x / y; + }) + .def("__rtruediv__", + [](const XoQuantity & y, double x) + { + return x / y; + }) + .def("__repr__", [](const XoQuantity & x) {