Skip to content

Kartmaan/math-functions-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

math-functions-rust

Some math functions in Rust

proba

Probability functions

  • proba_bool: Tests a probability by returning a bool
  • proba_some: Tests a probability by returning an Option
  • proba_result: Tests a probability by returning a Result
  • proba_attempts: The function tests a chosen probability, several attempts (with prints) will be made until the probability is realized.

prime_gen

Generates prime numbers

  • is_prime: Determines if a number is prime

fibonacci

Generates and checks Fibonacci numbers

  • fibo-gen: Generates the first k Fibonacci numbers in a vector.
  • is_fibo: Checks if a number is a Fibonacci number

combinations

Number of possible combinations in a given set

  • binomial_combi: Returns the binomial coefficient, which represents the number of ways to choose k elements from n elements, without repetition.
  • multiset_combi: Returns the number of multi-set combinations of k elements among n elements, which represents the number of ways to choose k elements among n elements with possible repetition.