-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStruct.h
executable file
·35 lines (30 loc) · 1.15 KB
/
Struct.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
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#pragma warning(disable : 4996)
#define BASE 4294967296
struct BigInt
{
unsigned int size;//количество цифр
unsigned int* index;//указатель
};
BigInt operator +(BigInt a, BigInt b);
BigInt operator -(BigInt a, BigInt b);
BigInt operator *(BigInt a, BigInt b);
BigInt mul(BigInt a, unsigned long long int b);//умножение на маленькое число
BigInt operator /(BigInt a, BigInt b);
BigInt div(BigInt a, unsigned long long int b);
BigInt operator % (BigInt a, BigInt b);
int operator > (BigInt a, BigInt b);//сравнивает два числа, возвращает 1 0 -1
BigInt shift(BigInt a, unsigned int s);//сдвиг
BigInt deg (BigInt a, BigInt b, BigInt c);//cтепень
BigInt freeindex(BigInt number);
BigInt memory_alloc(BigInt number, unsigned int size);
BigInt init(BigInt number, unsigned int size);
BigInt control(BigInt a);
BigInt ReadBin(const char* filename);
void WriteBin(const char* filename, BigInt number);
BigInt ReadText(const char* filename);
void WriteText(const char* filename, BigInt number);