[OCLUG-devel] question about bitwise ~

James Colannino james at colannino.org
Sat Jun 5 10:33:05 PDT 2004


Hey everyone.  I just have a simple question.  I learned that the ~ 
operator inverts all the bits in an operand.  So, for example, say that 
a byte (a character) contains 10000110.  It would become 01111001.  I've 
tried this on characters and integers.  Both work fine.  However, I 
tried this on a float, and I got the following error from the compiler:

error: wrong type argument to bit-complement

Does anyone know why this won't work on a floating point variable?  It 
seems to me that since all data types are constructed of bits, this 
should work, although the book has been very basic so far, and I also 
haven't finished the chapter, so I may be missing something.

James
-- 
My blog: http://www.crazydrclaw.com/
My homepage: http://james.colannino.org/

"There are no uninteresting things; only uninterested people." --G.K. 
Chesterton



More information about the OCLUG-devel mailing list