Skip to content

Add multiplyDivide function to fixed-point types#4478

Merged
turbolent merged 11 commits into
masterfrom
bastian/fixed-point-fmd
May 19, 2026
Merged

Add multiplyDivide function to fixed-point types#4478
turbolent merged 11 commits into
masterfrom
bastian/fixed-point-fmd

Conversation

@turbolent
Copy link
Copy Markdown
Member

@turbolent turbolent commented Apr 20, 2026

Description

Add a multiplyDivide function to all fixed-point types, backed by FMD methods in https://github.com/onflow/fixed-point:

  • Fix64.multiplyDivide(_ factor: Fix64, _ divisor: Fix64, rounding: RoundingRule): Fix64
  • UFix64.multiplyDivide(_ factor: UFix64, _ divisor: UFix64, rounding: RoundingRule): UFix64
  • Fix128.multiplyDivide(_ factor: Fix128, _ divisor: Fix128, rounding: RoundingRule): Fix128
  • UFix128.multiplyDivide(_ factor: UFix128, _ divisor: UFix128, rounding: RoundingRule): UFix128

The rounding parameter is optional and defaults to RoundingRule.towardZero


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@turbolent turbolent self-assigned this Apr 20, 2026
@turbolent turbolent requested a review from SupunS as a code owner April 20, 2026 22:55
@turbolent turbolent changed the title Add multipleDivide function to fixed-point types Add multiplyDivide function to fixed-point types Apr 21, 2026
@turbolent turbolent force-pushed the bastian/fixed-point-fmd branch from 522a819 to fab5f47 Compare April 22, 2026 23:29
Copy link
Copy Markdown
Member

@SupunS SupunS left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment thread sema/type.go
@turbolent turbolent requested a review from SupunS April 23, 2026 18:02
Copy link
Copy Markdown
Member

@SupunS SupunS left a comment

Choose a reason for hiding this comment

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

Nice!

Base automatically changed from bastian/fixed-point-rounding to master May 19, 2026 21:47
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 19, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions
Copy link
Copy Markdown

Benchstat comparison

  • Base branch: onflow:master
  • Base commit: 71810c7
Results

@turbolent turbolent enabled auto-merge May 19, 2026 22:04
@turbolent turbolent merged commit a9c132b into master May 19, 2026
15 of 17 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants