Skip to content

Commit

Permalink
UPDATE: change order of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
AwolDes committed Sep 26, 2021
1 parent 661e0ea commit 83eff32
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions index.rsh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
// Inspired by https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol
// Ensures Reach programs handle mathematical operations safely.

export const tryDiv = (a, b) => {
if (a == 0 || b == 0) {
return 0;
} else {
return a / b;
}
};

export const trySub = (a, b) => {
if (a < b) {
return 0;
Expand All @@ -29,6 +21,15 @@ export const tryAdd = (a, b) => {
}
};

export const tryDiv = (a, b) => {
if (a == 0 || b == 0) {
return 0;
} else {
return a / b;
}
};


export const tryMul = (a, b) => {
if (a == 0) {
return 0
Expand Down

0 comments on commit 83eff32

Please sign in to comment.