|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#6
|
||||||
|
||||||
|
Technically you should use NOT instead of ~ for things like this. Also, you should use AND instead of &. & will calculate the bitwise "and" of your two expressions, meaning it will apply the "and" to each individual set of bits. If it so happens that both p1_y > 127 as well as p2_y > 127 evaluate to exactly 1, it will work. Otherwise it may not. ~ Will compute the bitwise NOT of your expression. Assuming the inner part evaluates to 1, ~ will make it 1111111111111110 (65534).
If you ever wonder what an expression will evaluate to, try popping it in RoboEmu and doing a debug. For example, using: myVar= ~1 debug? myVar will give you: myVar=254 -and- myVar=0-1 debug? myVar will give you: myVar=255 Last edited by rbayer : 30-11-2002 at 13:11. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I'll delete this in a couple of hours. | hixofthehood | Chit-Chat | 9 | 04-02-2003 23:26 |
| couple of questions... | archiver | 2001 | 5 | 23-06-2002 22:48 |
| A couple of problems I observed at the MAR | archiver | 2000 | 3 | 23-06-2002 22:27 |
| Couple other thank yous | Jason Haaga | Thanks and/or Congrats | 0 | 29-04-2002 03:29 |
| A Couple Questions about Chairman's Award | ben_whly | Chairman's Award | 4 | 26-01-2002 18:24 |