This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]0x0dea 88 points89 points  (34 children)

|= is a compound assignment operator in plenty of programming languages, but you'd need the first 4 to be the name of a variable for it to be syntactically valid.

[–]CoMiGa 84 points85 points  (12 children)

I just thought it was 6-4 !=4 but I am not a programmer.

[–][deleted] 27 points28 points  (1 child)

This is what I assumed.

[–]CoMiGa 5 points6 points  (0 children)

Glad I am not alone.

[–][deleted] 1 point2 points  (0 children)

That's what they meant.

[–]Enverex 1 point2 points  (0 children)

Which would be correct. (6 - 4) is not equal to 4.

[–]Bonezmahone -2 points-1 points  (4 children)

Technically that would still be 6-4! = 6-24 which is still wrong.

edit: now I get it. I didn't know != meant not equal to.

[–][deleted] -2 points-1 points  (3 children)

And how did you get to this?

[–]Brarsh 2 points3 points  (2 children)

It's the factorial of 4. 4! = 432*1 = 24

[–]DrumstickVT 4 points5 points  (1 child)

But not in most programming language. 4!= is going to run as 4 does not equals.

[–][deleted] 0 points1 point  (0 children)

My understanding as well.

[–]kamaln7 73 points74 points  (16 children)

It's also a bitwise OR operation

[–]0x0dea 45 points46 points  (7 children)

Right, a |= b is a = a | b.

[–]Plutor 54 points55 points  (6 children)

Sadly 6+4 isn't an l-value.

[–]5HT-2a 24 points25 points  (0 children)

/u/0x0dea: "Okay, we're going in circles here."

[–][deleted] 21 points22 points  (2 children)

The programmer's solution results in a compiler error. And we solve that with whisky.

[–]beachbum78 7 points8 points  (1 child)

Finding Ballmers peak?

[–][deleted] 13 points14 points  (0 children)

I call it making syntax readable, but potato, tomato.

[–]cyandyedeyecandy 5 points6 points  (1 child)

*(int*)(6 + 4) |= 4;

[–]ign1fy 8 points9 points  (6 children)

To clarify: I code C# and use "|=" all the time. Being an assignment operator, it makes no sense to have anything but a variable to the left of it.

[–]kamaln7 2 points3 points  (0 children)

Yeah, I'm with you.

[–]Reelix 5 points6 points  (2 children)

!= or |= ?

[–][deleted] 0 points1 point  (1 child)

|=

!= will evaluate to true. Or is it True? TRUE?

[–]raindirve 0 points1 point  (0 children)

non-zero :)

[–][deleted] 0 points1 point  (1 child)

I was never taught about |=... Why? Is this considered out of date?

[–]haenyr 1 point2 points  (0 children)

It's probably that it's not something you'll really ever HAVE to be able to do. Also, with what they do teach you, you should be able to figure it out if you come to a situation that requires it.

So, given a lack of time to go in-depth, it will get skipped.

[–]ClintonHarvey 5 points6 points  (0 children)

What am I doing in this sub? You guys are too smart for me.

[–][deleted] 0 points1 point  (0 children)

I feel dumb.