A
A
alex14782020-01-14 20:36:08
css
alex1478, 2020-01-14 20:36:08

Bit operations in python?

Good afternoon. There was a question on bit operations.
When I perform a bitwise left shift in python 81905074 << 5, the result 2620962368
is the same operation returns a negative number in JavaScript. -1674004928
How do I get the same negative number in python?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RAX7, 2019-03-31
@sasha761

To make this, you need support for conic-gradient https://caniuse.com/#feat=css-conic-gradients and mask-image https://caniuse.com/#feat=css-masks , so it will be easier to make a picture.

D
Dmitry Shitskov, 2020-01-14
@alex1478

for example

import ctypes

print(ctypes.c_int(81905074 << 5).value)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question