[issue21712] fractions.gcd failure

Pablo Acosta report at bugs.python.org
Wed Jun 11 04:14:00 CEST 2014


Pablo Acosta added the comment:

I will correct myself one more time (hopefully the last):



	while b:
		a, b = b, round(a % b, 10)
	return a



a	b	fractions.gcd		proposed_algorithm
----------------------------------------------------------
48	18	6			6
3	4	1			1
2.7	107.3	8.881784197001252e-16	0.1
200.1	333	2.842170943040401e-14	0.3
0.05	0.02	3.469446951953614e-18	0.01

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21712>
_______________________________________


More information about the Python-bugs-list mailing list