xo-pyunit: + addition
This commit is contained in:
parent
19ef51cfe2
commit
d8580214d5
1 changed files with 19 additions and 0 deletions
|
|
@ -67,6 +67,25 @@ namespace xo {
|
|||
.def("reciprocal", &XoQuantity::reciprocal)
|
||||
.def("rescale", &XoQuantity::rescale,
|
||||
py::arg("unit"))
|
||||
|
||||
.def("__add__",
|
||||
[](const XoQuantity & x, const XoQuantity & y)
|
||||
{
|
||||
return x + y;
|
||||
})
|
||||
|
||||
.def("__add__",
|
||||
[](const XoQuantity & x, double y)
|
||||
{
|
||||
return x + y;
|
||||
})
|
||||
|
||||
.def("__radd__",
|
||||
[](double y, const XoQuantity & x)
|
||||
{
|
||||
return x + y;
|
||||
})
|
||||
|
||||
.def("__mul__",
|
||||
[](const XoQuantity & x, const XoQuantity & y)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue