* *** the following returns .t. (correct) ?Test(; 2^2 + ; 2^2 + ; 2^3 + ; 2^4 + ; 2^5 + ; 2^6 + ; 2^7 + ; 2^8 + ; 2^9 + ; 2^10 + ; 2^11 + ; 2^12 + ; 2^13 + ; 2^14 + ; 2^15 + ; 2^16 + ; 2^17 + ; 2^18 + ; 2^19 + ; 2^20 + ; 2^21 + ; 2^22 + ; 2^23 + ; 2^24 + ; 2^25 + ; 2^26 + ; 2^27 + ; 2^28 + ; 2^29 + ; 2^33, ; 2^33) * *** the following returns .f. (incorrect) ?Test(; 2^2 + ; 2^2 + ; 2^3 + ; 2^4 + ; 2^5 + ; 2^6 + ; 2^7 + ; 2^8 + ; 2^9 + ; 2^10 + ; 2^11 + ; 2^12 + ; 2^13 + ; 2^14 + ; 2^15 + ; 2^16 + ; 2^17 + ; 2^18 + ; 2^19 + ; 2^20 + ; 2^21 + ; 2^22 + ; 2^23 + ; 2^24 + ; 2^25 + ; 2^26 + ; 2^27 + ; 2^28 + ; 2^29 + ; 2^30 + ; 2^31 + ; 2^32 + ; 2^33, ; 2^33) Func Test LPARA ; MasterBit, ; TestBit LOCAL ; ReturnValue * *** this only works from 0 to 53 (like 2^53) IF IIF(; LOG(TestBit) / LOG(2) < 32, ; BITTEST(MasterBit, LOG(TestBit) / LOG(2)), ; BITTEST(MasterBit*2^-31, (LOG(TestBit) / LOG(2))-31)) ReturnValue = .T. ELSE ReturnValue = .F. ENDIF RETURN(ReturnValue)this still will not let me test correctly for large numbers. do you see what i am doing wrong here?
>?bitand(2^31, 2^31) = - 2^31 && shows .T. >?BITTEST(bitand(2^31, 2^31),31) && shows .T. >