Stefan Behnel <stefan...@behnel.de> added the comment:

Motivation for the latter:

$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a // b'
100000 loops, best of 5: 3.7 usec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a // 3'
100000 loops, best of 5: 3.49 usec per loop

$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a // b'
500000 loops, best of 5: 899 nsec per loop
$ ./python -m timeit -s 'from fractions import Fraction as F; a = F(-7, 3); b = 
F(3, 2)' 'a // 3'
500000 loops, best of 5: 729 nsec per loop

----------
title: Speed up mod/divmod for Fraction type -> Speed up mod/divmod/floordiv 
for Fraction type

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35588>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to