Skip to content

feat(wasm-encoder): expose Ieee32 and Ieee64 constructors#2268

Merged
alexcrichton merged 2 commits intobytecodealliance:mainfrom
michaelficarra:public-float-ctors
Jul 30, 2025
Merged

feat(wasm-encoder): expose Ieee32 and Ieee64 constructors#2268
alexcrichton merged 2 commits intobytecodealliance:mainfrom
michaelficarra:public-float-ctors

Conversation

@michaelficarra
Copy link
Contributor

This allows consumers who already have their float bit pattern as a u32/u64 to not have to go through a cast to f32/f64 just for the Ieee32 or Ieee64 constructors to cast it back. If being able to directly read/write the stored bit pattern is undesirable, I could impl new instead. It doesn't look like #2157 added any tests for this struct, so I didn't add any either.

@michaelficarra michaelficarra requested a review from a team as a code owner July 30, 2025 01:37
@michaelficarra michaelficarra requested review from alexcrichton and removed request for a team July 30, 2025 01:37
Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Instead of making fields public could constructors be added? That'll provide ideally more flexibility in the future while also being a bit more idiomatic.

@alexcrichton alexcrichton added this pull request to the merge queue Jul 30, 2025
Merged via the queue into bytecodealliance:main with commit 34d4cd8 Jul 30, 2025
34 checks passed
@michaelficarra michaelficarra deleted the public-float-ctors branch July 30, 2025 15:57
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