News for hackers. Stuff that matters.
Re:4B If Statements by nixpulvis on Friday December 12, 2025 @11:29AM (#46245693)
> This is time efficient* but rather wasteful of space.

You're saying that the blog's solution is time efficient. Which it is not. Your solution may be O(1) but it is also not efficient. As I'm sure you are aware.

I can tell you a practical solution which is also O(1) and takes up maybe 2 or 3 instructions of program code and no extra memory at all.

`x & 1` or `x % 2 != 0`

This blog post was taking a joke and running with it. And your comment is in that spirit as well, I just wanted to point out that it's by no means time efficient when we have 2s or 1s complement numbers which make this algorithm trivial.

Re:4B If Statements by icambron on Friday December 12, 2025 @11:38AM (#46245779)
You need to read their entire comment as a joke.
Re:4B If Statements by nixpulvis on Friday December 12, 2025 @11:48AM (#46245894)
I guess I should have been more clear that I was just pointing out the obvious in case some confused reader missed the joke.

lol

Re:4B If Statements by kbelder on Friday December 12, 2025 @12:14PM (#46246160)
Which was also obvious, but maybe also needed pointing out, which says something about online discussion. Something obvious, probably.
Re:4B If Statements by ricardo81 on Friday December 12, 2025 @12:12PM (#46246137)
explaining the joke spoils the joke, such is social convention.
Re:4B If Statements by nixpulvis on Friday December 12, 2025 @01:55PM (#46247377)
Forgive me for not being funny.
Re:4B If Statements by ricardo81 on Friday December 12, 2025 @10:37PM (#46251760)
It's alright. I don't make the rules.
Re:4B If Statements by henrikschroder on Friday December 12, 2025 @05:39PM (#46249890)
> I just wanted to point out that

We already know. Everybody knows. That's the joke. There's no need to point out anything.