Softegg 0 Posted March 3, 2004 i want to do a bit comparison to find out, if a bit is set in a value. sample: 40 and 32 -> result 32 other sample: 16 and 8 -> result 0 but the and-command in ofp does not work in this case. i am not such a big mathematican, so anyone knows a workaround for this? Share this post Link to post Share on other sites
vektorboson 8 Posted March 3, 2004 Well close to this comes: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _x = 40; if ( _x mod 64 >= 32 ) then { hint "32 bit set!"; }; untested, but it should work as intended. For the 8bit you must use _x mod 16 a.s.o. Share this post Link to post Share on other sites