| 524 | } |
| 525 | |
| 526 | static PyObject* |
| 527 | pyrational_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 | |
| 539 | static PyObject* |
| 540 | pyrational_str(PyObject* self) { |