Trait cyclos_core::libraries::unsafe_math::UnsafeMathTrait
source · [−]pub trait UnsafeMathTrait {
fn div_rounding_up(x: Self, y: Self) -> Self;
}Expand description
! Math functions that do not check inputs or outputs ! Contains methods that perform common math functions but do not do any ! overflow or underflow checks
Required methods
fn div_rounding_up(x: Self, y: Self) -> Self
fn div_rounding_up(x: Self, y: Self) -> Self
Returns ceil (x / y) Division by 0 throws a panic, and must be checked externally
In Solidity dividing by 0 results in 0, not an exception.
Arguments
x- The dividendy- The divisor