|
|
@ -95,22 +95,22 @@ float rest(float a, float b) { |
|
|
|
|
|
|
|
// groesster gemeinsammer Teiler |
|
|
|
float groesster_gemeinsammer_teiler(float a, float b) { |
|
|
|
float gr, kl; |
|
|
|
float gross, klein; |
|
|
|
float rest = 1; |
|
|
|
if (a > b) { |
|
|
|
gr = a; |
|
|
|
kl = b; |
|
|
|
gross = a; |
|
|
|
klein = b; |
|
|
|
} |
|
|
|
else { |
|
|
|
gr = b; |
|
|
|
kl = a; |
|
|
|
gross = b; |
|
|
|
klein = a; |
|
|
|
} |
|
|
|
while (rest != 0) { |
|
|
|
rest = fmod(gr, kl); |
|
|
|
gr = kl; |
|
|
|
kl = rest; |
|
|
|
rest = fmod(gross, klein); |
|
|
|
gross = klein; |
|
|
|
klein = rest; |
|
|
|
} |
|
|
|
return gr; |
|
|
|
return gross; |
|
|
|
} |
|
|
|
|
|
|
|
// kleinstes gemeinsammes Vielfaches |
|
|
|