@Atul: Try x = 0, a = 1, b = 2, for which (x > a && x < b) is false, but (x 
- a < b - x) is true.
 
Dave

On Saturday, October 27, 2012 5:43:17 AM UTC-5, ATul SIngh wrote:

> Thnks but i figured it out
> as 
> ( x >= a && x < b )  
> or 
> ( x >= a && x <= b )
>
> could be written as
> x -a < b - x    for first case
> x -a <= b - x     for sec one
>
> Second set is more optimised as it contains  only one comparison  and 
> minus is  much efficient than comparison operator.
>
>
>
> -- 
>
> *ATul Singh** Software Engineer**, Interra Systems*
> Mobile : +91-9971794013
> www.interrrasystems.com
> [image: Facebook] <http://www.facebook.com/atulsingh7890> [image: 
> Twitter]<http://www.twitter.com/atulsng>
>  [image: LinkedIn] <http://www.linkedin.com/in/atulsingh7890>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/pyvTrbonkq4J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to