Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

ksmolira's blog

By ksmolira, history, 4 years ago, In English

Hello!

Very quick question here. When converting fractions a/b, for a,b nonnegative and a,b<=N, what is the smallest N (order of magnitude) such that there exist two pairs a,b, a',b' such that a/b != a'/b' but when converted into a long double you get a collision? Would be slightly helpful to know tbf.

  • Vote: I like it
  • -6
  • Vote: I do not like it

| Write comment?
»
4 years ago, hide # |
← Rev. 2  
Vote: I like it +5 Vote: I do not like it

Honestly I have no idea, but at this point you can just do $$$a/b = a'/b' \iff a \cdot b' = a' \cdot b$$$ and avoid the issue entirely. Run away from doubles.