Overview of the Bits Package
The Bits package provides the ability to easily and efficiently perform bit-wise operations in Maple.
The underlying datatype for bit-wise operations is the integer, just as it is in C. Unlike C, however, bit-wise operations are not limited to hardware-sized integers (32 or 64 bits), but apply to integers of arbitrary length.
All operations are externally coded to provide greater efficiency.
The commands in the Bits package naturally split into several categories:
Import, Export, and Display
Bit Operations, Setting, and Queries
For several of the commands you must specify how many bits they are actually dealing with (as leading zero bits are not respected by the integer datatype). For any commands in this category, the optional argument bits=n should be provided.
Alternatively, you can use Settings to specify the default working bit count. Then, any commands that take the bits argument, when it is not specified, will use this value.
The option of working with signed integers generally requires that bits be set, and negative outputs (not the default) can also be requested using Settings. Note that by default, the Bits package uses 2s complement notation, so -1 = 11111... to however many bits are currently set.
Each function in the Bits package can be accessed by using either the long form or the short form of the function name in the command calling sequence.
v2 := Not(v1,bits=64);
Download Help Document
What kind of issue would you like to report? (Optional)