Calculating Pi to the Nth digit in hexadecimal format