请输入您要查询的字词:

 

单词 PythonCodeToCalculateEuclidsCoefficients
释义

Python code to calculate Euclid’s coefficients


Python code for calculating Euclid’s coefficients

\\PMlinkescapetext{def ExtGCD(x,y):  m,n=x,y  b,d=0,1  p,t=1,0  while (m!=0):    q = n//m  # yes, //    n,m=m,n-q*m    d,b=b,d-q*b    t,p=p,t-q*p  return (t*x+d*y,t,d)print ExtGCD(523,541) # Example from the parent entry}

and it displays

\\PMlinkescapetext{>>> (1, 30, -29)}

since

1=tx+dy=30523-29541
随便看

 

数学辞典收录了18232条数学词条,基本涵盖了常用数学知识及数学英语单词词组的翻译及用法,是数学学习的有利工具。

 

Copyright © 2000-2023 Newdu.com.com All Rights Reserved
更新时间:2025/5/5 2:51:34