-
-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: everything #10
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
Conversation
nberlette
commented
Jul 19, 2025
- chore: move trig/const/rand tests to src dir
- refactor(ieee754): abstract out common parts of float16/32/64 modules
- refactor(float16): use ieee754 abstractions for float16
- feat(float16): add float16/constants submodule
- feat(float16): add float16/guards submodule
- refactor(float32): use ieee754 abstractions for float32 ops
- feat(float32): add float32/constants submodule
- feat(float32): add float32/guards submodule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the IEEE-754 floating-point implementation by extracting common functionality into a shared abstraction layer. The changes consolidate duplicate code between float16 and float32 modules while adding new constants and type guard submodules.
- Introduces a shared IEEE-754 abstraction module to eliminate code duplication
- Adds constants and guards submodules for both float16 and float32 formats
- Moves test files from root to src directory for better organization
Reviewed Changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| src/random.test.ts | Updates import path to relative reference |
| src/internal/ieee754.ts | New shared IEEE-754 encoding/decoding abstraction |
| src/float32/round.ts | Minor comment formatting improvement |
| src/float32/mod.ts | Adds exports for new constants and guards submodules |
| src/float32/guards.ts | New type guard functions for float32 validation |
| src/float32/encode.ts | Refactored to use shared IEEE-754 abstraction |
| src/float32/decode.ts | Refactored to use shared IEEE-754 abstraction |
| src/float32/constants.ts | New constants module for float32 format specifications |
| src/float16/mod.ts | Adds exports for new constants and guards submodules |
| src/float16/guards.ts | New type guard functions for float16 validation |
| src/float16/encode.ts | Refactored to use shared IEEE-754 abstraction |
| src/float16/decode.ts | Refactored to use shared IEEE-754 abstraction |
| src/float16/constants.ts | New constants module for float16 format specifications |
| src/constants.test.ts | Updates import path to relative reference |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
feat: add positive zero guards, constants, and types (#9)