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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: buffer1.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Integers and Mathematical Correctness Date: Fri, 26 Sep 2014 19:38:20 +0300 Organization: Tidorum Ltd Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: individual.net EZC510Iw3UHcW83GHuzqTQAy7yJou3SJZGxxo1pkyGh906a6oZ Cancel-Lock: sha1:YfEpQey1eCvznl0L6kvq+kRfzVQ= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Xref: number.nntp.dca.giganews.com comp.lang.ada:189174 Date: 2014-09-26T19:38:20+03:00 List-Id: On 14-09-26 12:07 , vincent.diemunsch@gmail.com wrote: > Le vendredi 2 novembre 2001 02:40:08 UTC+1, Steven Deller a écrit : [ a mess of unformatted text ] > I thing there are two problems with the current Ada implementation : ... > 2. The very existence of the > > function "/" (Left, Right : Integer) return Integer; > > prevents the implementation and the use of Rational types in Ada, False. Ada can overload operators on the result type, so you can very well add function "/" (Left, Right : Integer) return Rational; and have both"/" visible and used with in-fix notation. > which are otherwise very simple to implement using a record type, > just like complex numbers. I beg to disagree. Rational numbers with Integer numerator and denominator are not very useful, because after a relatively small number of arithmetic operations, the numerator and denominator often become very large and overflow the Integer range. IMO rational numbers are useful only when the numerator and denominator are "bignums", effectively unbounded integer types. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .