The rationalize command converts floating point numbers to exact rational numbers.
rationalize(2.3); 23/10 rationalize(0.5*x + 2.3); 23/10+x/2