refactor: everything#10
Merged
Merged
Conversation
nberlette
commented
Jul 19, 2025
Owner
- 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
Contributor
There was a problem hiding this comment.
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 |
nberlette
commented
Dec 26, 2025
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.