# HG changeset patch
# User Michael Orlitzky <michael@orlitzky.com>
# Date 1326481026 18000
# Node ID a585bb23c445ed2f59a928869a10f521456b2032
# Parent 54da725b7cdd6aea343049ae5f8f9738b5e5a8cf
add a doctest for quo_rem() over the rationals
diff --git a/sage/rings/integer.pyx b/sage/rings/integer.pyx
a
|
b
|
|
2821 | 2821 | |
2822 | 2822 | INPUT: |
2823 | 2823 | |
2824 | | - ``other`` - the integer the divisor |
| 2824 | - ``other`` - the divisor |
2825 | 2825 | |
2826 | 2826 | OUTPUT: |
2827 | 2827 | |
2828 | | |
2829 | 2828 | - ``q`` - the quotient of self/other |
2830 | 2829 | |
2831 | 2830 | - ``r`` - the remainder of self/other |
… |
… |
|
2850 | 2849 | |
2851 | 2850 | sage: 3.quo_rem(ZZ['x'].0) |
2852 | 2851 | (0, 3) |
| 2852 | |
| 2853 | TESTS: |
| 2854 | |
| 2855 | The divisor can be rational as well, although the remainder |
| 2856 | will always be zero (trac #7965):: |
| 2857 | |
| 2858 | sage: 5.quo_rem(QQ(2)) |
| 2859 | (5/2, 0) |
| 2860 | sage: 5.quo_rem(2/3) |
| 2861 | (15/2, 0) |
| 2862 | |
2853 | 2863 | """ |
2854 | 2864 | cdef Integer q = PY_NEW(Integer) |
2855 | 2865 | cdef Integer r = PY_NEW(Integer) |