how to find n'th number in the decimal expansion of a proper fraction? Given three integers N,D,R write a program to output Rth digit after the decimal point in the decimal expansion for a given proper fraction N/D.
GolfScript 17

10\?@abs*\abs/10%


GolfScript can't handle real numbers well, but multiplying by powers of 10 is equivalent.

Here's an explanation and walkthrough with sample input, for any of you who are new to GolfScript, since I think this is a nice simple introduction:

59 -17 5
10\ #Place 10 on the stack and then switch the top 2 elements
-&gt; 59 -17 10 5
? #Exponentiate
-&gt; 59 -17 100000
@ #Rotate top 3 elements
-&gt; -17 100000 59
abs #Take absolute value of top element
-&gt; -17 100000 59
* #Multiply the top 2 elements
-&gt; -17 5900000
\ #Switch top 2 elements
-&gt; 5900000 -17
abs #Take absolute value of top element
-&gt; 5900000 17
/ #Do integer division
-&gt; 347058
10% #Place 10 on the stack and then take modulo
-&gt; 8