Skip to content

Fix FloatingPoint.frexp returning unsigned exponent#5113

Merged
SeanTAllen merged 1 commit intomainfrom
fix-frexp-return-type
Apr 4, 2026
Merged

Fix FloatingPoint.frexp returning unsigned exponent#5113
SeanTAllen merged 1 commit intomainfrom
fix-frexp-return-type

Conversation

@SeanTAllen
Copy link
Copy Markdown
Member

C's frexp writes a signed int for the exponent. The Pony wrapper declared it as U32, silently reinterpreting negative exponents as large positive values. Changed to I32 across the FFI declaration, the FloatingPoint trait, and the F32/F64 implementations.

Closes #5103

@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Apr 4, 2026
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Apr 4, 2026
@SeanTAllen SeanTAllen removed the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Apr 4, 2026
C's frexp writes a signed int for the exponent. The Pony wrapper
declared it as U32, silently reinterpreting negative exponents as
large positive values.

Closes #5103
@SeanTAllen SeanTAllen force-pushed the fix-frexp-return-type branch from 8025745 to 7847c98 Compare April 4, 2026 14:55
@SeanTAllen SeanTAllen merged commit ab9f2d5 into main Apr 4, 2026
16 checks passed
@SeanTAllen SeanTAllen deleted the fix-frexp-return-type branch April 4, 2026 17:29
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Apr 4, 2026
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.

FloatingPoint.frexp doesn't return signed integer

2 participants