Merge pull request #42 from tamasblummer/add_low_u64
add low_u64 to Uint256 and Uit128 types
This commit is contained in:
commit
91a786d22c
|
@ -38,6 +38,14 @@ macro_rules! construct_uint {
|
|||
arr[0] as u32
|
||||
}
|
||||
|
||||
/// Conversion to u64
|
||||
#[inline]
|
||||
pub fn low_u64(&self) -> u64 {
|
||||
let &$name(ref arr) = self;
|
||||
arr[0] as u64
|
||||
}
|
||||
|
||||
|
||||
/// Return the least number of bits needed to represent the number
|
||||
#[inline]
|
||||
pub fn bits(&self) -> usize {
|
||||
|
|
Loading…
Reference in New Issue