Feature #526
Fn to test if an integer is a power of 2
Status:
Closed
Priority:
Normal
Assignee:
Category:
New Function
Target version:
Description
It would be handy sometimes to have a function which says whether an integer is a power of 2; perhaps if its absolute value is a power of 2.
GMP does not have a direct fn for this.
History
#1 Updated by John Abbott about 10 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 90
I have implemented in IntOperations
both for BigInt
and MachineInt
.
Also added doc and some tests.
The fn says whether value is positive and is a power of 2.
#2 Updated by John Abbott about 10 years ago
- Status changed from Feedback to Closed
- % Done changed from 90 to 100