Skip to content

Hexadecimal floating point literals#4

Open
skirpichev wants to merge 6 commits intomainfrom
hex-floats
Open

Hexadecimal floating point literals#4
skirpichev wants to merge 6 commits intomainfrom
hex-floats

Conversation

@skirpichev
Copy link
Copy Markdown
Owner

@skirpichev skirpichev commented Oct 3, 2024

Add hexadecimal floating-point literals (IEEE 754-2008 §5.12.3) and support construction of floats from hexadecimal strings.

Implementation: skirpichev/cpython#10

@skirpichev

This comment was marked as resolved.

@skirpichev skirpichev closed this Oct 9, 2024
@skirpichev skirpichev deleted the hex-floats branch October 9, 2024 04:38
@skirpichev skirpichev restored the hex-floats branch December 12, 2024 08:29
@skirpichev skirpichev reopened this Dec 12, 2024
@skirpichev skirpichev marked this pull request as ready for review December 18, 2024 04:05
@skirpichev skirpichev closed this Apr 5, 2025
@skirpichev skirpichev deleted the hex-floats branch April 5, 2025 02:17
@skirpichev skirpichev restored the hex-floats branch April 17, 2025 06:35
@skirpichev skirpichev reopened this Apr 17, 2025
skirpichev added a commit to skirpichev/mpmath that referenced this pull request May 10, 2025
skirpichev added a commit to skirpichev/mpmath that referenced this pull request May 11, 2025
@skirpichev skirpichev changed the title Draft PEP: Hexadecimal floating point literals Hexadecimal floating point literals Oct 19, 2025
@Arusekk
Copy link
Copy Markdown

Arusekk commented Apr 16, 2026

I support this proposal. It would be very useful for representing floating-points related to testing floating point arithmetic implementations and other places needing bitwise exactness. Our Coreblocks project would directly benefit from it, instead of relying on custom representation: https://github.com/kuznia-rdzeni/coreblocks/blob/5a9d8f5165c0da5dbc9315b21c19704f9eba228e/test/func_blocks/fu/fpu/fpu_test_common.py#L66

@skirpichev
Copy link
Copy Markdown
Owner Author

@Arusekk, if this is helpful for you, probably you can use from_hex methods right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants