| 239 | } |
| 240 | |
| 241 | PyObject* PyBfloat16_TrueDivide(PyObject* a, PyObject* b) { |
| 242 | bfloat16 x, y; |
| 243 | if (SafeCastToBfloat16(a, &x) && SafeCastToBfloat16(b, &y)) { |
| 244 | return PyBfloat16_FromBfloat16(x / y).release(); |
| 245 | } |
| 246 | #if PY_MAJOR_VERSION < 3 |
| 247 | return PyArray_Type.tp_as_number->nb_divide(a, b); |
| 248 | #else |
| 249 | return PyArray_Type.tp_as_number->nb_true_divide(a, b); |
| 250 | #endif |
| 251 | } |
| 252 | |
| 253 | // Python number methods for PyBfloat16 objects. |
| 254 | PyNumberMethods PyBfloat16_AsNumber = { |
nothing calls this directly
no test coverage detected