An example: 13.7 = 137 / 10. You can convert to the exact floating-point numbers 137 and 10, then divide with a floating point division, and get the correctly rounded result. There is a huge range of decimal numbers that can be converted that way.
If this fails, you can do the calculation with higher precision than required, find the best possible upper bounds for the rounding error involved, and check whether or not you can guarantee a correctly rounded result.
(For example, if I wanted a value correctly rounded to an integer, and I can calculate the result with an error < 0.001, and I get a result of 15.4989, then I know the rounded result is 15. If I get a result of 15.4991, I don't know the correctly rouned result).
Then you have to decide what kind of rounding error is acceptable to you. Part 1 will give you in many cases (and in the majority of practical cases) the correctly rounded result very, very quickly. Part 2 will give you the proven correctly rounded result in 99% of cases if you use extended precison for a floating-point result, also quite quickly. Using quad precision you will get the proven correct result in practically all cases, but a bit slower. Conversion with infinite precision is trivial, but slow.
There is a special case: If you generated decimal numbers as good approximations to floating-point numbers (say storing floating-point numbers in a file in human readable format), then converting decimal to floating-point by using slightly higher precision will always be successful.