ll.c
1.11 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include "os.h"
long long
__ull_rshift (unsigned long long left, long long right)
{
return(left>>right);
}
unsigned long long
__ull_rem (unsigned long long left, unsigned long long right)
{
return(left % right);
}
unsigned long long
__ull_div (unsigned long long left, unsigned long long right)
{
return(left/right);
}
long long
__ll_lshift (long long left, long long right)
{
return(left<<right);
}
long long
__ll_rem (long long left, unsigned long long right)
{
return(left % right);
}
long long
__ll_div (long long left, long long right)
{
return(left/right);
}
long long
__ll_mul (long long left, long long right)
{
return(left*right);
}
void
__ull_divremi(unsigned long long *quotient, unsigned long long *remainder,
unsigned long long dividend, unsigned short divisor)
{
*quotient = dividend/divisor;
*remainder = dividend % divisor;
}
long long
__ll_mod(long long left, long long right)
{
long long rem;
rem = left % right;
if (((rem < 0) && (right > 0)) || ((rem > 0) && (right < 0)))
rem += right;
return(rem);
}
long long
__ll_rshift(long long left, long long right)
{
return(left>>right);
}