![]() |
|
Program Solution#5 - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7) +---- Thread: Program Solution#5 (/showthread.php?tid=4015) |
Program Solution#5 - eoredson - 10-21-2025 Interesting Note: Code: (Select All)
RE: Program Solution#5 - bplus - 10-21-2025 Paradox #5 Code: (Select All) f$ = "10"RE: Program Solution#5 - eoredson - 10-21-2025 Since when does: Code: (Select All) f$ = "10" g$ = "1"RE: Program Solution#5 - bplus - 10-21-2025 Yep that's when! RE: Program Solution#5 - SMcNeill - 10-21-2025 (10-21-2025, 01:34 AM)eoredson Wrote: Since when does: N paradox here. The results are exactly what you programed for. Code: (Select All)
2 AND 1 = 02 AND 2 = 2 2 AND 3 = 2 2 AND 4 = 0 2 AND 5 = 0 2 AND 6 = 2 2 AND 7 = 2 2 AND 8 = 0 2 AND 9 = 0 2 AND 10 = 2 AND is used for binary comparison of values. It compares bits. Let's look at 2 AND 3, for example: 00000010 <--- binary for 2 00000011 <--- binary for 3 ------------ <-- LET'S AND THEM!!! 00000010 <--- If the bits are both on, keep them if either is off, the result is off. So 2 AND 3 is 2. And since 2 is a non-zero value, and zero is the only number we count as FALSE, the result is TRUE. X AND Y is no where near the same code as X = Y. There's no paradox here. Just bad coding at work, and poor understanding of commands, at work -- which is more or less just part of programming. RE: Program Solution#5 - bplus - 10-21-2025 See how I set that up for you Steve? ![]() I knew AND was a bit thing but I was guessing it would be every other one that would "be equal" like odd and even numbers or a byte thing... but 2 on then 2 off... more that just one bit then but NOT a whole byte. Its the comparing to len(f$) = 2 then, OK. So lets try len(f$) = 7 Code: (Select All) f$ = "1000000"Calling them " Both equal.", still f's with the mind! LOL |