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

Function pyrational_str

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

Source from the content-addressed store, hash-verified

537}
538
539static PyObject*
540pyrational_str(PyObject* self) {
541 rational x = ((PyRational*)self)->r;
542 if (d(x)!=1) {
543 return PyUnicode_FromFormat(
544 "%ld/%ld",(long)x.n,(long)d(x));
545 }
546 else {
547 return PyUnicode_FromFormat(
548 "%ld",(long)x.n);
549 }
550}
551
552static npy_hash_t
553pyrational_hash(PyObject* self) {

Callers

nothing calls this directly

Calls 1

dFunction · 0.85

Tested by

no test coverage detected