Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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