MCPcopy Create free account
hub / github.com/numpy/numpy / pyrational_repr

Function pyrational_repr

numpy/core/src/umath/_rational_tests.c:526–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

524}
525
526static PyObject*
527pyrational_repr(PyObject* self) {
528 rational x = ((PyRational*)self)->r;
529 if (d(x)!=1) {
530 return PyUnicode_FromFormat(
531 "rational(%ld,%ld)",(long)x.n,(long)d(x));
532 }
533 else {
534 return PyUnicode_FromFormat(
535 "rational(%ld)",(long)x.n);
536 }
537}
538
539static PyObject*
540pyrational_str(PyObject* self) {

Callers

nothing calls this directly

Calls 1

dFunction · 0.85

Tested by

no test coverage detected