• 0 Posts
  • 78 Comments
Joined 1 year ago
cake
Cake day: July 24th, 2023

help-circle














  • The new version seems to fix that since your comment was written, but it will stil panics if less than 2 samples are provided, unless the crate it wraps panics at an earlier point.

    let peak = buf
                .iter()
                .copied()
                .enumerate()
                .take(self.sample_count / 2)
                .max_by_key(|(_, s)| (s.abs() * 1000.0) as u32)
                .expect("to have at least 1 sample");
    




  • anton@lemmy.blahaj.zonetoScience Memes@mander.xyzPolisci
    link
    fedilink
    English
    arrow-up
    1
    ·
    5 months ago

    I don’t know if prime factorization is the correct English word for it but the operation I am referring to takes a (non zero) natural number and returns a multiset of primes that give you the original number when multiplied together. Example: pf(12)={2,2,3} if we allowed 1 to be a prime then prime factorization cease to be a function as pf(12)={1,2,2,3} and pf(12)={1,1,1,1,2,2,3} become valid solutions.