Numworks Epsilon  1.4.1
Graphing Calculator Operating System
arithmetic.h
Go to the documentation of this file.
1 #ifndef POINCARE_ARITHMETIC_H
2 #define POINCARE_ARITHMETIC_H
3 
4 #include <poincare/integer.h>
5 namespace Poincare {
6 
7 class Arithmetic {
8 public:
9  static Integer LCM(const Integer * i, const Integer * j);
10  static Integer GCD(const Integer * i, const Integer * j);
11  /* When outputCoefficients[0] is set to -1, that indicates a special case:
12  * i could not be factorized. */
13  static void PrimeFactorization(const Integer * i, Integer * outputFactors, Integer * outputCoefficients, int outputLength);
14  constexpr static int k_numberOfPrimeFactors = 1000;
15  constexpr static int k_maxNumberOfPrimeFactors = 32;
16 private:
17  /* When decomposing an integer into primes factors, we look for its prime
18  * factors among integer from 2 to 10000. */
19  constexpr static int k_biggestPrimeFactor = 10000;
20 };
21 
22 }
23 
24 #endif
static Integer LCM(const Integer *i, const Integer *j)
Definition: arithmetic.cpp:6
static Integer GCD(const Integer *i, const Integer *j)
Definition: arithmetic.cpp:15
static void PrimeFactorization(const Integer *i, Integer *outputFactors, Integer *outputCoefficients, int outputLength)
Definition: arithmetic.cpp:39
static constexpr int k_maxNumberOfPrimeFactors
Definition: arithmetic.h:15
static constexpr int k_numberOfPrimeFactors
Definition: arithmetic.h:14