Блог пользователя Mario

Автор Mario, история, 6 лет назад, По-английски
  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

»
6 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +1 Проголосовать: не нравится

Precision problem, "long double" data type support a limited accuracy.

When x,y are small enough, there is no guarantee on the inequality $$$L \lt (L+R)/2 \lt R$$$ and compiler may gives you something like $$$L=(L+R)/2\leq R$$$. For instance all char in your problem are 'l' and your position are $$$1/2,1/4...,1/2^n$$$. Can the computer differentiate $$$1/2^{999990}$$$ and $$$1/2^{999991}$$$ properly? (In fact it treats $$$1/2^{16446}$$$ as $$$0$$$)