-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbigint.h
35 lines (24 loc) · 793 Bytes
/
bigint.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
/*Gabriel Zagury 2210912 3WB*/
/*Luiza Marcondes 2210275 3WA*/
#define NUM_BITS 128
typedef unsigned char BigInt[NUM_BITS / 8];
/* Atribuicao */
void big_sum_luiza(BigInt res, BigInt a, BigInt b);
/* res = val (extensao com sinal) */
void big_val(BigInt res, long val);
/* Operacoes aritmeticas */
/* res = -a */
void big_comp2(BigInt res, BigInt a);
/* res = a + b */
void big_sum(BigInt res, BigInt a, BigInt b);
/* res = a - b */
void big_sub(BigInt res, BigInt a, BigInt b);
/* res = a * b */
void big_mul(BigInt res, BigInt a, BigInt b);
/* Operacoes de deslocamento */
/* res = a << n */
void big_shl(BigInt res, BigInt a, int n);
/* res = a >> n (logico) */
void big_shr(BigInt res, BigInt a, int n);
/* res = a >> n (aritmetico) */
void big_sar(BigInt res, BigInt a, int n);