R.<x>=QQ[]
f = 4*x^3 - 3*x^2 - 2*x + 1
g = x + 1
print("División polinomio-polinomio\n")
f1 = walltime()
f.quo_rem(g)
walltime(f1)
print("\nDivisión polinomio-entero\n")
f2 = walltime()
f.quo_rem(12)
walltime(f2)
print("\nDivisión entero-entero (por quo_rem())\n")
f3 = walltime()
257.quo_rem(12)
walltime(f3)
print("\nDivisión entero-entero (por // y %)")
f4 = walltime()
257//12
257%12
walltime(f4)
División polinomio-polinomio
(4*x^2 - 7*x + 5, -4)
0.0007269382476806641
División polinomio-entero
(1/3*x^3 - 1/4*x^2 - 1/6*x + 1/12, 0)
0.0005190372467041016
División entero-entero (por quo_rem())
(21, 5)
0.0004420280456542969
División entero-entero (por // y %)
21
5
0.0007600784301757812