-
Notifications
You must be signed in to change notification settings - Fork 1
/
bigint.h
46 lines (29 loc) · 1.02 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
/*
* bigint.h -- big integer library
*/
#ifndef _BIGINT_H_
#define _BIGINT_H_
#include <stdio.h>
#include "support.h"
/* big integer processor registers */
typedef struct {
ObjRef op1; /* first (or single) operand */
ObjRef op2; /* second operand (if present) */
ObjRef res; /* result of operation */
ObjRef rem; /* remainder in case of division */
} BIP;
extern BIP bip; /* registers of the processor */
/* big integer processor functions */
int bigSgn(void); /* sign */
int bigCmp(void); /* comparison */
void bigNeg(void); /* negation */
void bigAdd(void); /* addition */
void bigSub(void); /* subtraction */
void bigMul(void); /* multiplication */
void bigDiv(void); /* division */
void bigFromInt(int n); /* conversion int --> big */
int bigToInt(void); /* conversion big --> int */
void bigRead(FILE *in); /* read a big integer */
void bigPrint(FILE *out); /* print a big integer */
void bigDump(FILE *out, ObjRef objRef); /* dump a big integer object */
#endif /* _BIGINT_H_ */