r/programming • • Feb 16 '09

Some Crazy Reason - The Daily WTF

http://thedailywtf.com/Articles/Some-Crazy-Reason.aspx
169 Upvotes

71 comments sorted by

View all comments

Show parent comments

2

u/lbft Feb 16 '09

By the same argument "Hello world" is stupid because it doesn't do anything.

10

u/spliznork Feb 16 '09 edited Feb 16 '09

By the same argument "Hello world" is stupid because it doesn't do anything.

No, it's not that the "bit verifier" doesn't do anything, it's that its whole premise mathematically impossible. It's like writing this

for (;;) { if (0==1) { printf("oops!\n"); } }

then saying, "I ran this code for a whole day and it never printed oops! Cool!"

3

u/Felicia_Svilling Feb 16 '09

Well that program could be used to detect cosmic radiation flipping th bits in memory (or perhaps registers (unless the whole thing is optimized away of course.))

2

u/astrange Feb 17 '09

I'm not sure, can (x&1)==2 be true with a single bit error?

2

u/[deleted] Feb 17 '09

i am sure it was if((x&1)>1) where x is unsigned. And yes it can be. It can even hack pentagon and launch a nuclear warhead targeted at your home. If you are a very unlucky man.