-
-
Notifications
You must be signed in to change notification settings - Fork 145
Add mulDiv function that accepts and returns UD60x18 arguments #260
Copy link
Copy link
Open
Labels
effort: mediumDefault level of effort.Default level of effort.priority: 2We will do our best to deal with this.We will do our best to deal with this.type: featureNew feature or request.New feature or request.work: clearSense-categorize-respond. The relationship between cause and effect is clear.Sense-categorize-respond. The relationship between cause and effect is clear.
Description
Activity
Metadata
Metadata
Assignees
Labels
effort: mediumDefault level of effort.Default level of effort.priority: 2We will do our best to deal with this.We will do our best to deal with this.type: featureNew feature or request.New feature or request.work: clearSense-categorize-respond. The relationship between cause and effect is clear.Sense-categorize-respond. The relationship between cause and effect is clear.
Discussed in #258
Originally posted by ivanvolov July 18, 2025
Description:
Currently,
mulDivonly supportsuint256arguments and returns auint256. While this is useful in many cases, using it in combination with other operations involvingUD60x18types often leads to repeated wrapping and unwrapping. This not only introduces verbosity but also makes the code less readable.Example (current):
Proposed Solution:
Add an overloaded version of
mulDivthat accepts and returnsUD60x18. This would simplify expressions and improve code clarity.Example (proposed):
This enhancement would be especially valuable when chaining multiple fixed-point operations, as it helps reduce boilerplate and potential errors.