rational number simulation