Are there no comparison functions? #110
Closed
antoniopgs
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
No, there aren't any in V2! But there will be comparison functions in V3: Side note - feel free to take the |
Beta Was this translation helpful? Give feedback.
2 replies
-
I have recently released v3.0.0, which means that PRBMath has comparison functions now 🥳 // SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.13;
import "@prb/math/UD60x18.sol";
function compare(UD60x18 x, UD60x18 y) pure returns (bool result) {
result = x.gt(y); // greater than
result = x.gte(y); // greater than or equal
result = x.lt(y); // less than
result = x.lte(y); // less than or equal
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a
a.greaterThan(b
) ora.lessThanOrEqualTo(b)
?Beta Was this translation helpful? Give feedback.
All reactions