Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

or'ed parameters

Name: Anonymous 2011-08-04 18:12

I noticed in a lot of game libraries that parameters are or'ed, like:

StartUp(init_this | init_that | init_the_other);

but doesnt bitwise or short circuit so that the first true parameter would return true?

Name: Anonymous 2011-08-04 19:17

awww ^_^ babby's first introduction to bitwise operations.

(hint:
this = 100
that = 010
other = 001
this|that|other = 111)

Name: Anonymous 2011-08-04 21:00

IHBT, but | is the bitwise or operator and || is the logical or operator.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-08-04 21:24

>>1
In a lot of programming languages, | and ||, don't behave the same way in the sense that one of them adheres to the 'math' definition of 'or' and the other one doesn't.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-08-04 21:25

>>3
No you haven't you dumbass. >>2 is just mixing up the 'or's.

Name: kodak+gallery_programmer !!kCq+A64Losi56ze 2011-08-04 21:35

>>5
I stand corrected. >>2 wasn't mixing up the 'or's. However, after further review, >>3 is still a dumbass.

Name: Anonymous 2011-08-04 21:59

>>4-6
Back to anywhere but /prog/, tripfag

Name: Anonymous 2011-08-04 22:02

>>3
It's logical or that does the short circuiting. Bitwise operates like >>2.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-08-04 22:16

>>8
Someone took a computer programming class. Now can you help >>7 get a clue?

Name: Anonymous 2011-08-04 22:18

>>9
Back to anywhere but /prog/, tripfag

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2011-08-04 22:26

>>10
Shouldn't you be helping a customer? Obviously programming isn't your forte.

Name: Anonymous 2011-08-04 22:35

>>11
u mad

Name: Anonymous 2011-08-04 22:35

>>11
Back to anywhere but /prog/, tripfag

Name: Anonymous 2011-08-06 0:42

/prog/ sure is autistic today!

Don't change these.
Name: Email:
Entire Thread Thread List