-2

I want to ask that how can I see if a value read is near the value saved in a constant. Is there a specific statement for that or is there any way to do that.
Awaiting your Replies.

Regards
Salik Sadruddin Merani

example:

//Here is what I mean
if ( a is near to b){
then do this
}
4

1 に答える 1

4
if( ( a>(b*0.98) ) && ( a<(b*1.02) ) )
{
    //we have %2 error tolerance here. Bee careful! Dont pass the tol. level.
    //do your work yourself, if you cant find, then ask us. Dont forget
    //to google
 }


if( abs(a-b)<(b*0.02) )
 {

  }

if ( abs((a-b)(a+b))<0.07 )
  {


   }


if(check(a,b))
{

}


if( pre_calculated )
{

 }
于 2012-08-13T10:47:51.933 に答える