[GAP Forum] Bitwise operators

Alexander Hulpke hulpke at math.colostate.edu
Fri Feb 19 17:09:24 GMT 2010



Dear Gabor Nagy,

> Is there some possibility for using bitwise operations (OR,AND,...) for integers in GAP?
> 
> Of course, I don't mean to reimplement these in GAP.
> 
> I mean access to the C and C++ operations.
The binary lists offer internal operations on a bit level, using the C. operations. However at the moment there is no function interpreting integers as bit lists or vice versa. nevertheless, as long as you want the bits only to store properties, binary lists should do the job.

Offering such operations for integers is somewhat problematic, because there are already different internal storages (depending on whether the integer is small or large) with further representations in the wings. I don't know whether any such representation is guaranteed to always be consistent with bitwise operations.

All the best,

Alexander Hulpke

-- Colorado State University, Department of Mathematics,
Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA
email: hulpke at math.colostate.edu, Phone: ++1-970-4914288
http://www.math.colostate.edu/~hulpke






More information about the Forum mailing list