⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 solvlincong.m

📁 Mathematical Methods by Moor n Stiling.
💻 M
字号:
function x = solvlincong(a,m,b) 
% 
% Ddetermine the solution to the linear congruence
% a x equiv b (mod m), if it exists
%
% function x = solvlincong(a,m,b)

% Copyright 1999 by Todd K. Moon

[g,x,y] = gcdint2(a,m);
if(rem(b,g))
  error('no solution to the congruence');
end
alpha = a/g;
beta = b/g;
mu = m/g;
[g1,alphabar,gamma] = gcdint2(alpha,mu);
x0 = mod(alphabar*beta,m);
x = mod(x0+(0:g-1)*mu,m);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -