public static long pow(long self, long pow) { if (pow < 0) throw ArgErr.make("pow < 0").val; long result = 1; for (; pow>0; pow>>=1) { if ((pow&1) == 1) result *= self; self *= self; } return result; }