Related articles |
---|
My scripting language - any suggestions? licaner@gmail.com (lican) (2008-08-25) |
Re: My scripting language - any suggestions? jaluber@gmail.com (Johannes) (2008-08-27) |
Re: My scripting language - any suggestions? lerno@dragonascendant.com (=?ISO-8859-1?Q?Christoffer_Lern=F6?=) (2008-08-27) |
Re: My scripting language - any suggestions? licaner@gmail.com (lican) (2008-08-29) |
Re: My scripting language - any suggestions? jaluber@gmail.com (Johannes) (2008-08-30) |
Re: My scripting language - any suggestions? mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2008-08-31) |
Re: My scripting language - any suggestions? ademakov@gmail.com (Aleksey Demakov) (2008-08-31) |
Re: My scripting language - any suggestions? mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2008-08-31) |
Re: My scripting language - any suggestions? licaner@gmail.com (lican) (2008-08-31) |
Re: My scripting language - any suggestions? mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2008-09-01) |
Re: My scripting language - any suggestions? ademakov@gmail.com (Aleksey Demakov) (2008-09-02) |
Re: My scripting language - any suggestions? mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2008-09-02) |
Re: My scripting language - any suggestions? licaner@gmail.com (lican) (2008-09-04) |
[6 later articles] |
From: | "Aleksey Demakov" <ademakov@gmail.com> |
Newsgroups: | comp.compilers |
Date: | Sun, 31 Aug 2008 21:04:15 +0700 |
Organization: | Compilers Central |
References: | 08-08-069 08-08-081 08-08-100 08-08-106 |
Keywords: | OOP, types |
Posted-Date: | 31 Aug 2008 10:06:35 EDT |
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.
Regards,
Aleksey
Return to the
comp.compilers page.
Search the
comp.compilers archives again.