Which base are you trying to determine the result in, there are many possible answers to your question. I think that we need to see some code to fully understand what you are trying to do here and to better offer a more targeted solution.