PyJsShift
JavaScript-flavored bitwise operations.
Usage
Import Module:
from pyjsbitwise import *
Cast int or float to 32-bit signed value:
i32cast(-2**31) # 2147483648
i32cast(2**53 / 3) # -1431655766
Bitwise not, and, or, xor like JavaScript's ~, &, |, ^:
bwnot(float("NaN")) # -1
bwand(2**32-1, 2**32-1) # -1
bwor(2**31, 2**53) # -2147483648
bwxor(2**31, 2**31-1) # -1
Shift left, right and unsigned right like JavaScript's <<, >>, >>>:
lshift(1, 32) # 1
rshift(-2, -31) # -1
urshift(-1, 0) # 4294967295
Metadata
Release files for PyJsBitwise 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyjsbitwise-1.0.2.tar.gz | 14.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| PyJsBitwise-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.1 kB
Release files / pyjsbitwise-1.0.2.tar.gz
| Download URL | pyjsbitwise-1.0.2.tar.gz |
|---|---|
| Size | 14.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b13ec20623c91b5a194b4b4f97d9a1a7089aa85595fbba7379eb5d1808448ba3
|
|
BLAKE2b-256 checksum How to use checksums |
868c6cce6be8e27a4f1aa0d29b3222c8dba24004e8e036794aaa4583c405350b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / PyJsBitwise-1.0.2-py3-none-any.whl
| Download URL | PyJsBitwise-1.0.2-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
17ce927611348d2499bb26ccbddd2bb47b683fd9e178e02839b5cc8bddd62ffc
|
|
BLAKE2b-256 checksum How to use checksums |
8e4dbf0830d48a4a971adaa6214f601b8ddc31d2d9d45ac777705504602fc571
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|