summaryrefslogtreecommitdiff
path: root/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c')
-rw-r--r--src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c b/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c
index 3d58623..121d26a 100644
--- a/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c
+++ b/src/c/elementaryFunctions/discrete_mathematics/gcd/u8gcda.c
@@ -31,7 +31,8 @@ uint8 u8gcdua(uint8* in,int size)
int x=*in;
int y=*(in+1);
int max=(x>y)?x:y;
- for(int i=max;i>=1;i--)
+ int i;
+ for(i=max;i>=1;i--)
{
if(x%i==0 && y%i==0)
{
@@ -39,12 +40,13 @@ uint8 u8gcdua(uint8* in,int size)
break;
}
}
- for(int j=2;j<size;j++)
+ int j;
+ for(j=2;j<size;j++)
{
x=temp;
y=*(in+j);
max=(x>y)?x:y;
- for(int i=max;i>=1;i--)
+ for(i=max;i>=1;i--)
{
if(x%i==0 && y%i==0)
{