Skip to content

Commit

Permalink
Merge pull request TheAlgorithms#64 from KaushalDevrari/patch-3
Browse files Browse the repository at this point in the history
Create linear_diophantine_eqn.m
  • Loading branch information
cozek authored Oct 5, 2020
2 parents f03f5d1 + 26a793a commit 69ae666
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions algorithms/maths/linear_diophantine_eqn.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
% Linear Diophantine Equation
%Given three integers a, b, c representing a linear equation of the form : ax + by = c.
%To find if the equation has a solution such that x and y are both integral values.
%Used in programming to find the exact solution exists or not.

function retval = linear_diophantine_eqn (a,b,c)
if c % gcd(a,b)==0
retval=true; % 1 represent yes it exist
else
retval= false; % 0 represent no it doesn't exist

end

0 comments on commit 69ae666

Please sign in to comment.