Help needed in Binary search EDU

Revision en1, by Xclusive_OR, 2021-12-05 16:28:34

Problem Link

in the good function bool good(double x){ double temp=( x*x + sqrt(x) ); if(temp-c>0) return 0; else if(temp-c<=0) return 1; } why are we doing,

if(temp-c>0) return 0; else if(temp-c<=0) return 1;

instead of return temp-c== 0;

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Xclusive_OR 2021-12-05 16:28:34 379 Initial revision (published)