Thursday, September 04 2008: Numberical Methodologies
I know someone out in FlogReaderLand knows this one (or can point me in the right direction). Given a floating point number (say 1.71285) how do I find out which two integers equal it when divided by one another? I'm not even sure what terms to use for a google search on this one. Help a h/cracker out.
RWH wrote:
1) Move the decimal point N places to the right until you have an integer, I.
2) Find the GCM, G, of I and 10^N (Easiest way to do this is get the prime factorization of both and collect like factors).
3) Your FPN is P/Q where P = I/G and Q = (10^N)/G.