This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

~30

 
Otto Deckelman
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the symbol is called a tilda, but correct me if I'm wrong. What does this mean and represent in computer math? Art M. replied to my question yesterday about bitwise shift operators and used this in his explanation.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Otto -
Yes, this symbol is called a tilde, and it is the bitwise inversion operator. Basically what it does is switch all the bit values of an integer value from 0 to 1 and from 1 to 0...
so :

So the bitwise inversion of 15 = -16 and the bitwise inversion of 30 = -31...
Does this make sense?
HTH,
-Nate
[This message has been edited by Nathan Pruett (edited April 06, 2001).]
 
Otto Deckelman
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, it helps alot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic