jpp/lab1/zad1/include/mod.h

32 lines
599 B
C

#ifndef _JPP_L1_Z1_MOD_H
#define _JPP_L1_Z1_MOD_H
#include <stdint.h>
/*
* computes the factorial of n
* only works on natural numbers
*/
uint64_t factorial(uint64_t n);
/*
* computes the gcd of a and b
* only works on natural numbers
*/
uint64_t gcd(uint64_t a, uint64_t b);
/*
* the solution of a linear diophantine equation
*/
typedef struct {
int64_t n;
int64_t m;
} Result;
/*
* computes the solution of a linear diophantine equation ax + by = c
* or returns NULL if it doesn't exist
*/
Result *diophantine(int64_t a, int64_t b, int64_t c);
#endif // _JPP_L1_Z1_MOD_H