Best to use an example to describe the problem. Lets say I have a decimal value 100.227273.
100.227273 * X = Y
I need to find the smallest positive integer X that gives integer Y.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the 100.227273 is just an approximation and you want to get the best rational approximation, use continued fractions.
Take 100.227273 as example.
So you get
Simplify this expression to get 2205/22.
[Editor’s note: For example code, see this answer.]