Basically, i'm going to take two integers, divide them, and then find the nth digit to the right of the "."
So for example, if I divide 5/156, the answer (it repeats, so this is not perfect) is: .0320512820512820512820512820512820512820512820512820
if I want to find the second digit, its 3
if I want to find the fourth digit, its 0
I cant simply do division here, because any data type will truncate the value. So I need to create a loop and do a process over and over. I know it has something to do with mod, but im not sure what.
Unfortunately, its very difficult for me to present code for someone to analyze for a mathematical process that I dont understand, so im hoping someone can help me figure out a formula that I can loop over to just keep finding arbitrary digits in a decimal expansion.
This post has been edited by NecroWinter: 13 February 2013 - 07:02 PM