xo-pyunit: + equality comparison
This commit is contained in:
parent
e7e8396543
commit
692b26754c
1 changed files with 18 additions and 0 deletions
|
|
@ -150,6 +150,24 @@ namespace xo {
|
|||
return x / y;
|
||||
})
|
||||
|
||||
.def("__eq__",
|
||||
[](const XoQuantity & x, const XoQuantity & y)
|
||||
{
|
||||
return x == y;
|
||||
})
|
||||
|
||||
.def("__eq__",
|
||||
[](const XoQuantity & x, double y)
|
||||
{
|
||||
return x == y;
|
||||
})
|
||||
|
||||
.def("__req__",
|
||||
[](const XoQuantity & y, double x)
|
||||
{
|
||||
return x == y;
|
||||
})
|
||||
|
||||
.def("__repr__",
|
||||
[](const XoQuantity & x)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue