forked from leopoldabgn/unbounded_int_C
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunbounded_int.h
43 lines (36 loc) · 1.54 KB
/
unbounded_int.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef UNBOUNDED_INT_H
#define UNBOUNDED_INT_H
/* STUCTURES */
typedef struct chiffre {
struct chiffre *suivant;
char c;
struct chiffre *precedent;
} chiffre;
typedef struct {
char signe;/* soit ’+’ soit ’-’ */
size_t len;/* longueur de la liste */
chiffre *premier;/* pointeur vers le premier élément de la liste*/
chiffre *dernier;/*pointeur vers le dernier élément de la liste*/
} unbounded_int;
/* FONCTIONS */
unbounded_int string2unbounded_int(const char *e);
unbounded_int ll2unbounded_int(long long i);
char *unbounded_int2string(unbounded_int i);
int unbounded_int_cmp_unbounded_int(unbounded_int a, unbounded_int b);
int unbounded_int_cmp_ll(unbounded_int a, long long b);
unbounded_int unbounded_int_somme(unbounded_int a, unbounded_int b);
unbounded_int unbounded_int_difference(unbounded_int a, unbounded_int b);
unbounded_int unbounded_int_produit(unbounded_int a, unbounded_int b);
void print_unbounded_int(unbounded_int u);
void print_unbounded_int_left(unbounded_int u);
void destroy_unbounded_int(unbounded_int u);
unbounded_int calculate(unbounded_int a, char op, unbounded_int b);
unbounded_int unbounded_int_copy(unbounded_int u);
unbounded_int unbounded_int_dividing_2(unbounded_int a);
char* decimal_to_binary(unbounded_int nb);
unbounded_int binary_to_decimal(char* bin);
int is_valid_uint(unbounded_int nb);
unbounded_int unbounded_int_modulo(unbounded_int nb, unbounded_int mod);
unbounded_int unbounded_int_division(unbounded_int a, unbounded_int b);
char * binary_division(char *a, char * b);
#endif