remove error with 0^k when k<=0 and make division and modulo faster! (faster than bc :P)