Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How set and especially clear bits?

I try

n.set_bit(7)

No set_bit, clear_bit methods for n. Next I try clear by bit mask

x = 14
n = 1
mask = ~(1 << n)

but ~ means in sage 1/x

Is good solution using subtraction? Fore example 2^256 - 1 - 2^32