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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e41c540121b84783 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!newsgate.cistron.nl!news2.euro.net!amsnews01.chello.com!amsnews14.chello.com!amstwist00.POSTED!53ab2750!not-for-mail From: Reinert Korsnes Subject: Re: How to use "infinite" ? Newsgroups: comp.lang.ada References: <43BDACAF.C20E2840@fakeaddress.nil> User-Agent: KNode/0.9.0 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit Message-ID: <3Arvf.3306$zc1.1420@amstwist00> Date: Fri, 06 Jan 2006 11:25:02 +0100 NNTP-Posting-Host: 84.210.199.61 X-Complaints-To: abuse@chello.no X-Trace: amstwist00 1136543103 84.210.199.61 (Fri, 06 Jan 2006 11:25:03 MET) NNTP-Posting-Date: Fri, 06 Jan 2006 11:25:03 MET Xref: g2news1.google.com comp.lang.ada:2456 Date: 2006-01-06T11:25:02+01:00 List-Id: Gautier Write-only wrote: > Dmitry A. Kazakov: > >> You should define an abstract data type to represent the set of integer >> numbers + ideals you want (such as "negative infinity", "positive >> infinity") . For example a universal package could be generic: >> >> generic >> type Finite_Integer is range <>; >> package Integers_With_Infinity_Ideals is >> type Infinite_Integer is private; >> -- >> -- Unary operations >> -- >> function "+" (Left : Infinite_Integer) return Infinite_Integer; >> function "-" (Left : Infinite_Integer) return Infinite_Integer; >> -- >> -- Dyadic operations >> -- >> function "+" (Left : Finite_Integer; Right : Infinite_Integer) >> return Infinite_Integer; > [...] > > Great idea, you just drafted a (or the first ?) computer package for > nonstandard analysis! > > I strongly suggest to use the (hem...) standard wording of nonstandard > analysis for the types (unlimited, infinitesimal, etc.). :-) well, for my limited "hack-programming" I would like to replace the following with something simpler: if a /= Integer'Last and b /= Integer'Last then if a > a + b then a := a + b; end if; end if; I tried to represent "infinite" with Integer'Last - directly from the mathematical specification/problem formulation given. Maybe it is not a good idea. Note, by the way, that the construct above may be rather ugly if a and b are complex expressions.... reinert > ______________________________________________________________ > Gautier -- http://www.mysunrise.ch/users/gdm/index.htm > Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm > > NB: For a direct answer, e-mail address on the Web site!