Skip to main content

IEEE 754 float module with bit-operation and round arithmetic support

Project description

py_ieee754

cov

IEEE 754 float number python module with bit-operation and round arithmetic support.

Usage

>>> import py_ieee754 as pi7
>>> import ctypes as ct

# Construction
>>> pi7.F32(1.5)
F32(0b0_01111111_10000000000000000000000)
>>> pi7.F64.from_components("0", "0"*11, "1"*52)# construct from sign, exp and sig bits
F64(0b0_00000000000_1111111111111111111111111111111111111111111111111111)
>>> pi7.F32.from_bits(0x3FC00000)               # from bit pattern
F32(0b0_01111111_10000000000000000000000)
>>> pi7.IEEE754.from_ctypes(ct.c_float(1.5))    # auto-dispatch (→ F32)
F32(0b0_01111111_10000000000000000000000)

# Field access & classification
>>> a = pi7.F32(1.5)
>>> a.sign, a.exponent, a.significand, a.bits
(0, 127, 4194304, 1069547520)
>>> a.is_nan, a.is_inf, a.is_zero, a.is_subnormal, a.is_normal
(False, False, False, False, True)

# Arithmetic with rounding
>>> pi7.add(pi7.F32(1.0), pi7.F32(2.0), round_mode=pi7.RoundingMode.DOWNWARD)
F32(0b0_10000000_10000000000000000000000)

# math.h functions with ctypes interface, round control and fenv exceptions
>>> pi7.math.sqrt(ct.c_double(2.0))
c_double(1.4142135623730951)
>>> pi7.math.fma(
            ct.c_double(1.5), 
            pi7.F64.from_bits(1).ctypes_value, 
            ct.c_double(0), 
            round_mode=pi7.RoundingMode.DOWNWARD)
c_double(5e-324) # = bit 0b1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

py_ieee754-0.1.0-py3-none-win_arm64.whl (35.5 kB view details)

Uploaded Python 3Windows ARM64

py_ieee754-0.1.0-py3-none-win_amd64.whl (38.8 kB view details)

Uploaded Python 3Windows x86-64

py_ieee754-0.1.0-py3-none-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl (39.7 kB view details)

Uploaded Python 3manylinux: glibc 2.31+ x86-64manylinux: glibc 2.34+ x86-64

py_ieee754-0.1.0-py3-none-manylinux_2_31_aarch64.manylinux_2_34_aarch64.whl (38.3 kB view details)

Uploaded Python 3manylinux: glibc 2.31+ ARM64manylinux: glibc 2.34+ ARM64

py_ieee754-0.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (39.7 kB view details)

Uploaded Python 3manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

py_ieee754-0.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (38.3 kB view details)

Uploaded Python 3manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

py_ieee754-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl (37.7 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

py_ieee754-0.1.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (39.6 kB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

py_ieee754-0.1.0-py3-none-macosx_26_0_x86_64.whl (35.0 kB view details)

Uploaded Python 3macOS 26.0+ x86-64

py_ieee754-0.1.0-py3-none-macosx_15_0_arm64.whl (35.2 kB view details)

Uploaded Python 3macOS 15.0+ ARM64

File details

Details for the file py_ieee754-0.1.0-py3-none-win_arm64.whl.

File metadata

  • Download URL: py_ieee754-0.1.0-py3-none-win_arm64.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_ieee754-0.1.0-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 43fc27ae0cd1be32c38758063a23dd739c66893b4477fbdf4634f023d4b14da0
MD5 f589463fdcdac946b237a63362fcf27f
BLAKE2b-256 b7de6ccfe591cc66102ebadf779407773e43492d0d10169d81042979ed1e0446

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-win_arm64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_ieee754-0.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: py_ieee754-0.1.0-py3-none-win_amd64.whl
  • Upload date:
  • Size: 38.8 kB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for py_ieee754-0.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 cac2549a33b9917e0dae4693cd6ba4cfd1dcaac37d267283eb4ff49c988fdc26
MD5 3220b42438b1b633161c2611f8505766
BLAKE2b-256 5bde5731f780b83fae60e35a632d37422494ac0bb385a1c1ccb65376214ada03

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-win_amd64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_ieee754-0.1.0-py3-none-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for py_ieee754-0.1.0-py3-none-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2043fa588d6fe45a58f7b5c029608dddd2a4363d9aa7d568dc9b8d9b76c04ef5
MD5 e4524067d21280c3de05e62c123a3679
BLAKE2b-256 6c07c95ce70edaa1fc6bfefd24e07114d484a3240f583a0f88143423e9226010

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-manylinux_2_31_x86_64.manylinux_2_34_x86_64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_ieee754-0.1.0-py3-none-manylinux_2_31_aarch64.manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for py_ieee754-0.1.0-py3-none-manylinux_2_31_aarch64.manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 3a6b018cf77992f3944923f80856ec65f9209e9195d99f4a40b1537b5bb258c7
MD5 44cef8b4044f26fcea882ff781427667
BLAKE2b-256 679427a8fd8ef0b15fe1612003adbf16e8c58dc46add9bf3e363db4a67256e60

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-manylinux_2_31_aarch64.manylinux_2_34_aarch64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_ieee754-0.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for py_ieee754-0.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 54e285446dad189b5b80d027b56d89fe1bccfe7c31ec45be5bca06c0b84d1f58
MD5 6bf55b561e54475608cc65e496c0956f
BLAKE2b-256 7a184ef219c6408d80631d3e50990584ccf8ccd1c84ebee1909e11b942502b79

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_ieee754-0.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for py_ieee754-0.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 10dc69df7e4f2119b1442645c3c0d89705b1cb1fc5ceca1fb21c5db4253457cf
MD5 19de0e9119846de07f6fefc4de4bbfc4
BLAKE2b-256 000756e0dc204d5d9f525ee24b201043a3e247a10aa393955e7c93c8f26f6d40

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_ieee754-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl.

File metadata

File hashes

Hashes for py_ieee754-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Algorithm Hash digest
SHA256 0b6d5e423baae1d203d16c3fb7c15cb2fc5a8c5f9ef449cd72281e862ea40afd
MD5 17b055b114d0483623a49b95a6d69608
BLAKE2b-256 4801e95640423bf4b792c31cdbfc32eb74c630f5eb3a0974bde0a3891d032d88

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_ieee754-0.1.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl.

File metadata

File hashes

Hashes for py_ieee754-0.1.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl
Algorithm Hash digest
SHA256 0991a848ff8132f6a33bc916e1f290ecdd403d1f46048592dd1ed09fd7a182ba
MD5 bf2d3022bf8a35d5fc3162da51fb383c
BLAKE2b-256 ac05b4726f955bcd3a7451ae856eb3f9185726306cf0fd54d5c67c335fc2d97f

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_ieee754-0.1.0-py3-none-macosx_26_0_x86_64.whl.

File metadata

File hashes

Hashes for py_ieee754-0.1.0-py3-none-macosx_26_0_x86_64.whl
Algorithm Hash digest
SHA256 90c1b87bb36e26b3484fd63d1d040c3ad074e0854e1022761957f06d4c7ae318
MD5 77386436ea6bc12e16f67e7e559f140d
BLAKE2b-256 3d05bb1755eba052ca85a1d26a327b19fb0dd8ad79b3af844ab1ddc2210a7c9f

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-macosx_26_0_x86_64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file py_ieee754-0.1.0-py3-none-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for py_ieee754-0.1.0-py3-none-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 86dfc06350402ab99301f9db77ec3b6ce27cf45f7fc2c674932983dd2373e45f
MD5 866466af610a05763512a11fb9d231dd
BLAKE2b-256 49266712792eea5303d6d6f6d9bb72dcf4c22d65af94cb8ee3febb1633134b91

See more details on using hashes here.

Provenance

The following attestation bundles were made for py_ieee754-0.1.0-py3-none-macosx_15_0_arm64.whl:

Publisher: release.yml on LXYan2333/py_ieee754

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page