diff --git a/src/utils/precision.cairo b/src/utils/precision.cairo index 227ac299..e237865e 100644 --- a/src/utils/precision.cairo +++ b/src/utils/precision.cairo @@ -427,7 +427,7 @@ fn exp(x: u256) -> u256 { //check if x is not too big, but it's already checked in exp 2? let uLOG2_E = 1_442695040888963407; let double_unit_product = x * uLOG2_E; - exp2(double_unit_product/1000000000000000000) + exp2(double_unit_product / 1000000000000000000) } /// Compute factor from value and divisor with a roundup. diff --git a/tests/utils/test_precision.cairo b/tests/utils/test_precision.cairo index c7af2957..b8684378 100644 --- a/tests/utils/test_precision.cairo +++ b/tests/utils/test_precision.cairo @@ -106,14 +106,12 @@ fn test_exp() { let value4: u256 = 0000000000000000000; let value5: u256 = 1000000000000000000; - let result1 = precision::exp(value1); let result2 = precision::exp(value2); let result3 = precision::exp(value3); let result4 = precision::exp(value4); let result5 = precision::exp(value5); - assert(result1 == 7389056098930650223, 'should be 7389056098930650223'); assert(result2 == 12182493960703473424, 'should be 12182493960703473424'); assert(result3 == 1777474199233404337144, 'should_1777474199233404337144');