Skip to content

Add multiplyDivide function to fixed-point types#4478

Open
turbolent wants to merge 9 commits intobastian/fixed-point-roundingfrom
bastian/fixed-point-fmd
Open

Add multiplyDivide function to fixed-point types#4478
turbolent wants to merge 9 commits intobastian/fixed-point-roundingfrom
bastian/fixed-point-fmd

Conversation

@turbolent
Copy link
Copy Markdown
Member

@turbolent turbolent commented Apr 20, 2026

Depends on #4474
Depends on #4473

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

  • 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
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