Skip to content

Commit

Permalink
doc(core): add comment on PolynomialSize::log2
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeul-zama committed Oct 9, 2024
1 parent 2b14b22 commit c4785f7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tfhe/src/core_crypto/commons/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ pub struct PolynomialSize(pub usize);

impl PolynomialSize {
/// Return the associated [`PolynomialSizeLog`].
/// If the polynomial size is not a power of 2, returns the ceil of its log2
pub fn log2(&self) -> PolynomialSizeLog {
PolynomialSizeLog((self.0 as f64).log2().ceil() as usize)
}
Expand Down

0 comments on commit c4785f7

Please sign in to comment.