symbolic4
math_foundation.c File Reference
#include "symbolic4.h"

Go to the source code of this file.

Functions

uintmax_t min (uintmax_t a, uintmax_t b)
 
uintmax_t max (uintmax_t a, uintmax_t b)
 
uintmax_t euclidean_gcd (uintmax_t a, uintmax_t b)
 Computes the GCD of two integers. More...
 
expressionprime_factors (uintmax_t source)
 
uintmax_t * binomial_coefficients (uint8_t n)
 
uint8_t addition (uintmax_t *result, uintmax_t a, uintmax_t b)
 
uint8_t multiplication (uintmax_t *result, uintmax_t a, uintmax_t b)
 
uint8_t int_power (uintmax_t *result, uintmax_t base, uintmax_t exponent)
 
void int_root (uintmax_t *factor, uintmax_t *remainder, uintmax_t base, uintmax_t degree)
 

Function Documentation

◆ addition()

uint8_t addition ( uintmax_t *  result,
uintmax_t  a,
uintmax_t  b 
)

Definition at line 124 of file math_foundation.c.

◆ binomial_coefficients()

uintmax_t* binomial_coefficients ( uint8_t  n)

Definition at line 106 of file math_foundation.c.

◆ euclidean_gcd()

uintmax_t euclidean_gcd ( uintmax_t  a,
uintmax_t  b 
)

Computes the GCD of two integers.

This function computes the greatest common divisor of two integers using the iterative Euclidean algorithm.

Parameters
[in]aThe first integer.
[in]bThe second integer.
Returns
  • The greatest common divisor.

Definition at line 51 of file math_foundation.c.

◆ int_power()

uint8_t int_power ( uintmax_t *  result,
uintmax_t  base,
uintmax_t  exponent 
)

Definition at line 142 of file math_foundation.c.

◆ int_root()

void int_root ( uintmax_t *  factor,
uintmax_t *  remainder,
uintmax_t  base,
uintmax_t  degree 
)

Definition at line 152 of file math_foundation.c.

◆ max()

uintmax_t max ( uintmax_t  a,
uintmax_t  b 
)

Definition at line 32 of file math_foundation.c.

◆ min()

uintmax_t min ( uintmax_t  a,
uintmax_t  b 
)

Definition at line 28 of file math_foundation.c.

◆ multiplication()

uint8_t multiplication ( uintmax_t *  result,
uintmax_t  a,
uintmax_t  b 
)

Definition at line 133 of file math_foundation.c.

◆ prime_factors()

expression* prime_factors ( uintmax_t  source)

Definition at line 65 of file math_foundation.c.