library.sol 475 B

1234567891011121314
  1. library InstanceLibrary {
  2. function getMax(uint64 a, uint64 b) external pure returns (uint64) {
  3. return a > b ? a : b; // If 'a' is greater than 'b', it returns 'a'; otherwise, it returns 'b'.
  4. }
  5. }
  6. contract TestContract {
  7. using InstanceLibrary for uint64;
  8. // Calculate and return the maximum value between x and 65536 using the InstanceLibrary.
  9. function calculateMax(uint64 x) public pure returns (uint64) {
  10. return x.getMax(65536);
  11. }
  12. }