mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-10 03:56:49 +00:00
Merge branch 'master' into patch-anon-vma
This commit is contained in:
commit
daf8732bbd
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,3 +10,4 @@ serial_opt.txt
|
|||||||
user/sys_api_lib
|
user/sys_api_lib
|
||||||
|
|
||||||
docs/_build
|
docs/_build
|
||||||
|
draft
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -120,7 +120,8 @@
|
|||||||
"screen_manager.h": "c",
|
"screen_manager.h": "c",
|
||||||
"textui.h": "c",
|
"textui.h": "c",
|
||||||
"atomic.h": "c",
|
"atomic.h": "c",
|
||||||
"uart.h": "c"
|
"uart.h": "c",
|
||||||
|
"fat_ent.h": "c"
|
||||||
},
|
},
|
||||||
"C_Cpp.errorSquiggles": "Enabled",
|
"C_Cpp.errorSquiggles": "Enabled",
|
||||||
"esbonio.sphinx.confDir": ""
|
"esbonio.sphinx.confDir": ""
|
||||||
|
@ -3,8 +3,19 @@
|
|||||||
|
|
||||||
int64_t pow(int64_t x, int y)
|
int64_t pow(int64_t x, int y)
|
||||||
{
|
{
|
||||||
|
if (y == 0)
|
||||||
|
return 1;
|
||||||
|
if (y == 1)
|
||||||
|
return x;
|
||||||
|
if (y == 2)
|
||||||
|
return x * x;
|
||||||
int64_t res = 1;
|
int64_t res = 1;
|
||||||
for (int i = 0; i < y; ++i)
|
while (y != 0)
|
||||||
|
{
|
||||||
|
if (y & 1)
|
||||||
res *= x;
|
res *= x;
|
||||||
|
y >>= 1;
|
||||||
|
x *= x;
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user