MCPcopy Create free account
hub / github.com/WheretIB/nullc / vmLongPow

Function vmLongPow

NULLC/Executor.cpp:28–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28long long vmLongPow(long long num, long long pow)
29{
30 if(pow < 0)
31 return (num == 1 ? 1 : 0);
32 if(pow == 0)
33 return 1;
34 if(pow == 1)
35 return num;
36 if(pow > 64)
37 return num;
38 long long res = 1;
39 int power = (int)pow;
40 while(power)
41 {
42 if(power & 0x01)
43 {
44 res *= num;
45 power--;
46 }
47 num *= num;
48 power >>= 1;
49 }
50 return res;
51}
52
53#if defined(_M_X64)
54#ifdef _WIN64

Callers 1

Executor.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected