mirror of
https://github.com/ETLCPP/etl.git
synced 2026-06-20 02:46:44 +08:00
Added mask to final result of fold_bits()
This commit is contained in:
parent
69575b0e99
commit
b46357da05
4
binary.h
4
binary.h
@ -67,7 +67,7 @@ namespace etl
|
||||
template <const size_t NBITS>
|
||||
const typename max_value_for_nbits_helper<NBITS>::value_type max_value_for_nbits_helper<NBITS>::value;
|
||||
}
|
||||
|
||||
|
||||
/// Definition for non-zero NBITS.
|
||||
template <const size_t NBITS>
|
||||
struct max_value_for_nbits
|
||||
@ -490,7 +490,7 @@ namespace etl
|
||||
}
|
||||
|
||||
// Fold the remaining bits.
|
||||
folded_value ^= value;
|
||||
folded_value ^= value & mask;
|
||||
|
||||
return folded_value;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user