Program to find GCD of floating point numbers | Recursive function to return gcd of a and b ; base case ; Driver Code
< ? php function gcd ( $ a , $ b ) { if ( $ a < $ b ) return gcd ( $ b , $ a ) ; if ( abs ( $ b ) < 0.001 ) return $ a ; else return ( gcd ( $ b , $ a - floor ( $ a / $ b ) * $ b ) ) ; } $ a = 1.20 ; $ b = 22.5 ; echo gcd ( $ a , $ b ) ; ? >