-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathllmuldiv.c
53 lines (46 loc) · 1.04 KB
/
llmuldiv.c
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
unsigned long long __ull_rshift(unsigned long long a0, unsigned long long a1)
{
return a0 >> a1;
}
unsigned long long __ull_rem(unsigned long long a0, unsigned long long a1)
{
return a0 % a1;
}
unsigned long long __ull_div(unsigned long long a0, unsigned long long a1)
{
return a0 / a1;
}
unsigned long long __ll_lshift(unsigned long long a0, unsigned long long a1)
{
return a0 << a1;
}
long long __ll_rem(unsigned long long a0, long long a1)
{
return a0 % a1;
}
long long __ll_div(long long a0, long long a1)
{
return a0 / a1;
}
unsigned long long __ll_mul(unsigned long long a0, unsigned long long a1)
{
return a0 * a1;
}
void __ull_divremi(unsigned long long *div, unsigned long long *rem, unsigned long long a2, unsigned short a3)
{
*div = a2 / a3;
*rem = a2 % a3;
}
long long __ll_mod(long long a0, long long a1)
{
long long tmp = a0 % a1;
if ((tmp < 0 && a1 > 0) || (tmp > 0 && a1 < 0))
{
tmp += a1;
}
return tmp;
}
long long __ll_rshift(long long a0, long long a1)
{
return a0 >> a1;
}