Represent it internally as either fixed or floating point and divide to convert in and out if needed.
With a nice type system you could even genericize the type over integer constants