Hi, I have written the following function to calculate GCD of floating point numbers, but when I run this for (111.6, 46.5), the calculation of fmod(a,b) in the funciton starts giving the wrong result after 2 recursive calls. I am unable to find the error here. Can anyone please help me with this?
float gcd(float a, float b){
if (a>b) {
if(b==0){
return a;
}
else {
return gcd(b, fmod(a,b));
}