Simple question. I have two ctypes.c_double. I would like to add or subtract them together.
I want to be able to say something like this:
In [1]: c_double(2) + c_double(2)
Out[1]: c_double(4.0)
Currently, when I try this I get an error: TypeError: unsupported operand type(s) for +: 'c_double' and 'c_double'
My current workaround is this:
In [1]: result = c_double(2).value + c_double(2).value
In [2]: c_double(result)
Out[2]: c_double(4.0)
Is there a way to directly add/subtract ctypes.cdouble?