Skip to content

Improve math#78

Merged
Kay-Zee merged 9 commits intomainfrom
bastian/math-improvements
Dec 20, 2025
Merged

Improve math#78
Kay-Zee merged 9 commits intomainfrom
bastian/math-improvements

Conversation

@turbolent
Copy link
Copy Markdown
Member

Description

  • Replace FlowCreditMarketMath.one and zero with 1.0 and 0.0 literals
  • Replace FlowCreditMarketMath.toUFix128 with call of UFix128 conversion function or literal
  • Replace FlowCreditMarketMath.div with division operator, it already checks for division by zero
  • Remove redundant code:
    • Static casts (e.g. 0.0 as UFix64)
    • Conversion function calls (e.g. UFix64(0.0))
    • Multiply with/divide by 1.0
    • Type annotations that can be inferred (e.g. let x: UFix64 = 0.0)

For contributor use:

  • 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 Dec 17, 2025
@turbolent turbolent requested a review from a team as a code owner December 17, 2025 23:00
@turbolent turbolent mentioned this pull request Dec 18, 2025
6 tasks
Copy link
Copy Markdown
Member

@Kay-Zee Kay-Zee left a comment

Choose a reason for hiding this comment

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

Great! thanks @turbolent , we had done some similar work involving removing the unecessary div calls and constants in the FlowYieldVaults repo but had not gotten back around to doing it here, so this is amazing! And the includes further clean up beyond those as well. ✅

@Kay-Zee Kay-Zee merged commit 96d42d6 into main Dec 20, 2025
1 check passed
@Kay-Zee Kay-Zee deleted the bastian/math-improvements branch December 20, 2025 00:06
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.

2 participants