From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00,FROM_WORDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fd63afa4dc364b7e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-26 19:42:03 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!skynet.be!news.tele.dk!207.115.63.138!newscon04.news.prodigy.com!prodigy.com!newsmst01!postmaster.news.prodigy.com!newssvr16.news.prodigy.com.POSTED!not-for-mail From: "Ken Garlington" Newsgroups: comp.lang.ada References: <98m938$2iod0$1@ID-25716.news.dfncis.de><98pgs1$32up7$1@ID-25716.news.dfncis.de><98umc6$39coj$1@ID-25716.news.dfncis.de> <3ABFFD67.6EBDA7B@votehere.net> Subject: Re: Static typing (Was Re: Better support for garbage collection) Organization: ex-FlashNet, now Prodigy X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-Mimeole: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: NNTP-Posting-Host: 65.67.102.143 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr16.news.prodigy.com 985664012 6207069 65.67.102.143 (Mon, 26 Mar 2001 22:33:32 EST) NNTP-Posting-Date: Mon, 26 Mar 2001 22:33:32 EST Date: Tue, 27 Mar 2001 03:33:32 GMT Xref: supernews.google.com comp.lang.ada:6099 Date: 2001-03-27T03:33:32+00:00 List-Id: "Andrew Berg" wrote in message news:3ABFFD67.6EBDA7B@votehere.net... : : Ken Garlington wrote: : > : > "Robert A Duff" wrote in message : > news:wccelvrp7xk.fsf@world.std.com... : > : "Ken Garlington" writes: : > : : > : > Can't see why, since the terms "rational number" and "floating-point : > number" : > : > are not the same. I think I'd be much more bothered by a floating-point : > : > number without a (floating) point! : > : : > : Well, as it happens, "one half" is both a rational and (on most : > : machines) a floating point number. Not to mention a fixed point : > : number. ;-) : > : > Actually, I think "one half" is a string. :) : > : > More generally, of course, there are rational numbers that are not exactly : > representable as floating point numbers, so I don't see why a compiler : > should accept x/y as a floating-point literal. : : Okay, but then by that argument there are some decimal numbers that are : not exactly representable as floting point numbers, so I don't see why a : compiler should accept 0.1 as a floating-point literal. Because 0.1 is the exact "short-hand" notation for the rational number 1/10. (How this is represented in a given*underlying hardware model* is, of course, a different issue). Class project: Type the rational number 1/3 in the same "short-hand" notation (keeping the underlying assumption of base 10, of course). (Of course, the issue is somewhat OBE, now that 1/2 is no longer "one half", but is instead "1 divided by 2" :) : After all, all 0.1 is is a silly way to write 1/10. True. The more correct notation would be 0.1E0 (or, some would probably argue, 1.0E-1). This would certainly make it easier to tell whether the number was intended to be fixed-point or floating point. : I'd myself like : better support for dealing with rational bignums, but that's a different : thing entirely. And with enough time and operator overloading probably : would not require tons of compiler support, unless we want them to be : reasonably fast. :( : : -andrew