public fun rev(num: BigDecimal): BigDecimal {
    let fractional = f();
    BigDecimal {
        scaled: biguint::div(biguint::mul(fractional, fractional), num.scaled)
    }
}
#[test]
#[expected_failure(abort_code = 0x10065, location = 0x1::biguint)]
fun test_bigdecimal_rev_zero() {
    let num = zero();
    rev(num);
}
INCLUDING DEPENDENCY MoveNursery
INCLUDING DEPENDENCY MoveStdlib
BUILDING InitiaStdlib
Running Move unit tests
[ PASS    ] 0x1::bigdecimal::test_bigdecimal_rev_zero

Test Statistics:


                 Test Name                     Time             Gas Used          

 0x1::bigdecimal::test_bigdecimal_rev_zero    0.018                799            


Test result: OK. Total tests: 1; passed: 1; failed: 0
public fun rev(num: BigDecimal): BigDecimal {
+    assert!(
+        !biguint::is_zero(num.scaled),
+        error::invalid_argument(EDIVISION_BY_ZERO)
+    );
    let fractional = f();
    BigDecimal {
        scaled: biguint::div(biguint::mul(fractional, fractional), num.scaled)
    }
}
