Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Float16Schema #37

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Add Float16Schema #37

merged 3 commits into from
Oct 29, 2024

Conversation

reczkok
Copy link
Contributor

@reczkok reczkok commented Oct 14, 2024

This PR adds support for Float16 schema. Since the support for DataView float16 functions and Float16Array is very limited it does not rely on them. Instead, it provides two functions numberToFloat16 and float16ToNumber that are simple conversion functions based on the IEEE 754 format (essentially binary64 -> binary16).

What it does:

  • Adds a Float16Schema that supports reading/writing binary16 floats
  • Adds utility functions that convert binary64 (number) to binary16 (float16)
  • Adds tests for Float16Schema I/O

What it lacks:

  • Support for f16Array

Copy link
Owner

@iwoplaza iwoplaza left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! Just have one note, other than that, amazing work 🌟

packages/typed-binary/src/io/bufferIOBase.ts Outdated Show resolved Hide resolved
@reczkok reczkok requested a review from iwoplaza October 22, 2024 09:13
@iwoplaza iwoplaza added this to the 4.2.0 milestone Oct 22, 2024
Copy link
Owner

@iwoplaza iwoplaza left a comment

Choose a reason for hiding this comment

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

Awesome job! 🌟 💛

@iwoplaza iwoplaza merged commit f6a6850 into iwoplaza:master Oct 29, 2024
4 checks passed
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