- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
signed ToBool(signed b){unsigned t=b;return ( ((t<<0)>>31) | ((t<<1) >>31) | ((t<<2) >>31) | ((t<<3) >>31) | ((t<<4) >>31) | ((t<<5) >>31) | ((t<<6) >>31) | ((t<<7) >>31) | ((t<<8) >>31) | ((t<<9) >>31) | ((t<<10) >>31) | ((t<<11) >>31) | ((t<<12) >>31) | ((t<<13) >>31) | ((t<<14) >>31) | ((t<<15) >>31) | ((t<<16) >>31) | ((t<<17) >>31) | ((t<<18) >>31) | ((t<<19) >>31) | ((t<<20) >>31) | ((t<<21) >>31) | ((t<<22) >>31) | ((t<<23) >>31) | ((t<<24) >>31) | ((t<<25) >>31) | ((t<<26) >>31) | ((t<<27) >>31) | ((t<<28) >>31) | ((t<<29) >>31) | ((t<<30) >>31) | ((t<<31) >>31) );};
signed NotBool(signed b){/*signed b=ToBool(b);*/unsigned t=(~b)<<31;return t>>31;};
signed isZero(signed a){return NotBool(ToBool(a));};
signed isNotZero(signed a){return NotBool(isZero(a));};
signed isSign(signed a){unsigned t=a;return (t>>31);};signed isNotSign(signed a){return NotBool(isSign(a));};
signed isEqual(signed a,signed b){ return isZero(a-b);};
signed isNotEqual(signed a,signed b){return NotBool(isEqual(a,b));};
signed isLess(signed a,signed b){return isSign(a-b);};
signed isEqualMore(signed a,signed b){return NotBool(isLess(a,b));};
signed isEqualLess(signed a,signed b){return isEqual(a,b)|isLess(a,b);};
signed isMore(signed a,signed b){return NotBool(isEqualLess(a,b));};
signed Equal(signed a,signed b,signed success,signed fail){signed t=isEqual(a,b);return (success*t)+(fail*NotBool(t));};
signed NotEqual(signed a,signed b,signed success,signed fail){signed t=NotBool(isEqual(a,b));return (success*t)+(fail*NotBool(t));};
signed Less(signed a,signed b,signed success,signed fail){signed t=isLess(a,b);return (success*t)+(fail*NotBool(t));};
signed More(signed a,signed b,signed success,signed fail){signed t=isMore(a,b);return (success*t)+(fail*NotBool(t));};
signed EqualLess(signed a,signed b,signed success,signed fail){signed t=isEqualLess(a,b);return (success*t)+(fail*NotBool(t));};
signed EqualMore(signed a,signed b,signed success,signed fail){signed t=isEqualMore(a,b);return (success*t)+(fail*NotBool(t));};
Вот такое форматирование... Хотя функции какие-то сомнительные...