Macro solana_sdk::unchecked_div_by_const [−][src]
macro_rules! unchecked_div_by_const { ($num:expr, $den:expr) => { ... }; }
Expand description
Convenience macro for doing integer division where the opersation’s safety can be checked at compile-time
Since unchecked_div_by_const!()
is supposed to fail at compile-time, abuse
doctests to cover failure modes
Literal denominator div-by-zero fails
ⓘ
Const denominator div-by-zero fails
ⓘ
Non-const denominator fails
ⓘ
Literal denominator div-by-zero fails
ⓘ
Const denominator div-by-zero fails
ⓘ
Non-const denominator fails
ⓘ
Literal denominator div-by-zero fails
ⓘ
Const denominator div-by-zero fails
ⓘ
Non-const denominator fails
ⓘ