Hey,
I need help in someone checking my solution to 1720A - Burenka Plays with Fractions #815 Div2, Problem A. 168812095 The number to multiply lower fraction is (higher_fraction/lower_fraction). Now to check if this number is integer or not, I used int(num) == num logic. If its equal num is int, else float. accordingly the number of claps.
Please let me know what i'm missing here.
Thanks
Computations on floating point numbers are not that exact.
To compare a/b and c/d the best way is comparing a*d and c*b
if frac1 = 1e9 (a = 1e9, b = 1) and frac2 = 1e-9 (c = 1, d = 1e9), then the result will be really close to zero (1e-18), so it might get rounded down to zero.
Pretty sure it's mainly case 2 as I got same problem during contest (168814722 fails, but 168833377 works).