Converting decimal number into different base representation