Re: [algogeeks] Re: Range Checking Efficiently C++

2012-11-02 Thread Atul Singh
@biku look at the conditions where x is equal to b when a x b suppose 1 5 5 , it should give FALSE ... -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe

Re: [algogeeks] Re: Range Checking Efficiently C++

2012-11-02 Thread Atul Singh
Yours can be used at the situation when a x = b , Good one ., -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] Re: Range Checking Efficiently C++

2012-10-30 Thread Atul Singh
i have attached a file consisting first by comparison and second by XORING biku,.,. u shuld have a look at that.. -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe

Re: [algogeeks] Re: Range Checking Efficiently C++

2012-10-28 Thread Atul Singh
srry for my wrong typo.. it should be * unsinged( x - a ) (unsigned)b - a* works only for positive a and b a = b -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To

Re: [algogeeks] Re: Range Checking Efficiently C++

2012-10-28 Thread Vikram Pradhan
how about ...if( (a-x)^(b-x) 0) On Sat, Oct 27, 2012 at 9:21 PM, Dave dave_and_da...@juno.com wrote: @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

Re: [algogeeks] Re: Range Checking Efficiently C++

2012-10-28 Thread Vikram Pradhan
we can use masking of most significant bit of the xor of (a-x) and ( b-x) to check if axb if [ ((a-x)^(b-x)) 0x8000 ] then it's in range else not in range On Sat, Oct 27, 2012 at 11:17 PM, Vikram Pradhan vpradha...@gmail.comwrote: how about ...if( (a-x)^(b-x) 0)

Re: [algogeeks] Re: Range Checking Efficiently C++

2012-10-28 Thread Ravi Ranjan
biku u also dere in this group... coool bro :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to

Re: [algogeeks] Re: Range Checking Efficiently C++

2012-10-27 Thread Dave
@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 - xfor first case