On Sun, Aug 31, 2008 at 4:26 PM, Dmitry A. Kazakov
<mailbox@dmitry-kazakov.de> wrote:> In a language with an elaborated types system Integer and Float would have> subtyping relation making explicit conversions unnecessary, for instance> when Integer were a subtype of Float, then it could inherit contravariant> Floor from Float:>> Floor : Integer -> Float (contravariant in the result)

If Integer is a subtype of Float then how would you deal with the
representation of floating point numbers?

If you use hardware-supported 32-bit representation of floats then
there will be a problem with precision. Some Int values cannot not be
precisely represented as floats.

If you use your own representation of Floats then you will have
inefficient floating point ops.