Skip to content

Commit

Permalink
log, power return FPDecimalError now
Browse files Browse the repository at this point in the history
  • Loading branch information
DrunkRandomWalker committed Oct 31, 2023
1 parent bc61143 commit 8d6104f
Show file tree
Hide file tree
Showing 8 changed files with 176 additions and 139 deletions.
2 changes: 1 addition & 1 deletion packages/injective-math/src/fp_decimal/arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl FPDecimal {
}

FPDecimal {
num: U256::try_from(num).unwrap(),
num: U256::try_from(num).unwrap(), // panic only in MIN_FPDeciaml/-1
sign: 1 ^ x.sign ^ y.sign,
}
}
Expand Down
5 changes: 5 additions & 0 deletions packages/injective-math/src/fp_decimal/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#[derive(Debug, PartialEq, Eq)]
pub enum FPDecimalError {
Undefined(String),
NotSupported(String),
}
Loading

0 comments on commit 8d6104f

Please sign in to comment.