Skip to content

feat(bfloat16): add arithmetic operations with mode support#4

Open
dndungu wants to merge 28 commits intozerfoo:mainfrom
dndungu:feat/bfloat16-arithmetic
Open

feat(bfloat16): add arithmetic operations with mode support#4
dndungu wants to merge 28 commits intozerfoo:mainfrom
dndungu:feat/bfloat16-arithmetic

Conversation

@dndungu
Copy link
Contributor

@dndungu dndungu commented Mar 4, 2026

Summary

  • Add BFloat16 Add/Sub/Mul/Div with IEEE and strict arithmetic modes
  • Overflow/underflow detection with configurable rounding
  • Fix golangci-lint v2 config (add version: "2", separate formatters)
  • Remove temporary calc file

Test plan

  • New arithmetic tests in bfloat16_arithmetic_test.go
  • Existing convert tests pass

dndungu added 28 commits July 29, 2025 02:38
Adds more tests for the math and arithmetic packages to increase overall test coverage.

- Adds tests for Pow, Exp, Exp2, Log, Log2, Log10, Sin, Cos, Tan, Floor, Ceil, Round, Trunc, Mod, and Hypot in math_extra_test.go.

- Adds tests for AddWithMode, MulWithMode, DivWithMode, Equal, Less, Min, Max, and slice operations in arithmetic_extra_test.go.

- Corrects precision issues in math_extra_test.go.
Adds more tests for the convert package to increase overall test coverage.

- Adds tests for FromFloat64 and ToFloat64 in convert_extra_test.go.
Adds more tests for the types package to increase overall test coverage.

- Adds tests for Error, String, GoString, Class, and leadingZeros10 in types_extra_test.go.
Adds more tests for the arithmetic package to increase overall test coverage.

- Adds tests for AddWithMode, MulWithMode, and DivWithMode in arithmetic_extra_test.go.
Adds more tests for the arithmetic package to increase overall test coverage.

- Adds tests for MulWithMode and DivWithMode in arithmetic_extra_test.go.
Adds more tests for the convert package to increase overall test coverage.

- Adds tests for FromFloat64WithMode in convert_extra_test.go.
Adds more tests for the convert package to increase overall test coverage.

- Adds tests for FromFloat64WithMode in convert_extra_test.go.
- Apply general refactoring and cleanup to core float16 files.
- Add .golangci.yml with standard Go linters
- Enable gofmt, govet, staticcheck, misspell, etc.
- Set timeout and complexity thresholds
Add BFloat16 Add/Sub/Mul/Div with IEEE and strict modes, overflow/underflow
detection, and configurable rounding. Fix golangci-lint v2 config. Remove
temporary calc file.
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.

1 participant