Add a bit length function that's handy for macros.

This commit is contained in:
2018-11-14 21:33:58 -05:00
parent 1a2f3aaa7a
commit 62e36d79cb
2 changed files with 10 additions and 1 deletions

View File

@@ -67,6 +67,10 @@ macro_rules! signed_impls {
fn zero() -> $sname {
$sname{ negative: false, value: $name::zero() }
}
fn bit_length() -> usize {
$name::bit_length()
}
fn is_zero(&self) -> bool {
self.value.is_zero()