jpp/lab1/zad7/c/wrapper.h

33 lines
679 B
C

#ifndef _JPP_L1_Z7_WRAPPER_H
#define _JPP_L1_Z7_WRAPPER_H
#include <stdbool.h>
/*
* computes the gcd of a and b
* only works on natural numbers
*/
extern unsigned int gcd(unsigned int a, unsigned int b);
/*
* computes the factorial of n
* only works on natural numbers
*/
extern unsigned int factorial(unsigned int n);
/*
* the solution of a linear diophantine equation
*/
typedef struct {
bool resultExists;
int n;
int m;
} Result;
/*
* computes the solution of a linear diophantine equation ax + by = c
* if the solution doesn't exist Result::resultExists == false
*/
extern Result diophantine(int a, int b, int c);
#endif // _JPP_L1_Z7_WRAPPER_H