00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 #include "comma/runtime/commart.h"
00013 
00014 int32_t _comma_pow_i32_i32(int32_t x, uint32_t n)
00015 {
00016     int32_t res = x;
00017 
00018     if (n == 0)
00019         return 0;
00020 
00021     while (--n)
00022         res *= x;
00023 
00024     return res;
00025 }
00026 
00027 int64_t _comma_pow_i64_i32(int64_t x, uint32_t n)
00028 {
00029     int64_t res = x;
00030 
00031     if (n == 0)
00032         return 0;
00033 
00034     while (--n)
00035         res *= x;
00036 
00037     return res;
00038 }