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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a37:9f09:: with SMTP id i9mr14773903qke.60.1591451932196; Sat, 06 Jun 2020 06:58:52 -0700 (PDT) X-Received: by 2002:a9d:22aa:: with SMTP id y39mr10983833ota.76.1591451931979; Sat, 06 Jun 2020 06:58:51 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sat, 6 Jun 2020 06:58:51 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=185.22.143.66; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 185.22.143.66 References: <45af26dc-c35f-4a01-8115-7b30021cc064@googlegroups.com> <835a8c6a-54a8-4157-bcf1-e889d18b1b46@googlegroups.com> <87y2p186ot.fsf@nightsong.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Any good package for mathematical function in Ada? From: AdaMagica Injection-Date: Sat, 06 Jun 2020 13:58:52 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:58982 Date: 2020-06-06T06:58:51-07:00 List-Id: Am Samstag, 6. Juni 2020 09:06:57 UTC+2 schrieb Dmitry A. Kazakov: > No, it is the type system. Randy posted links to the drafts for > unbounded integer and real. Same story. They are not numbers. As a > consequence you have no conversions to/from legal numeric types, you > need to instantiate generics. They do not match formal numeric types in > generics. They have no attributes (some of which would have no sense > anyway). GNAT CE 2020 has them (albeit not in the latest RM form). They behave much like numbers. pragma Warnings (Off); with Ada.Numerics.Big_Numbers.Big_Integers, Ada.Numerics.Big_Numbers.Big_Reals; use Ada.Numerics.Big_Numbers.Big_Integers, Ada.Numerics.Big_Numbers.Big_Reals; pragma Warnings (On); with Ada.Text_IO; use Ada.Text_IO; procedure Main is I: Big_Integer := From_String (" 42 "); J: Big_Integer := 42; R: Big_Real := From_String("10.0")**100 - 1.0; S: Big_Real := 10.0**100 - 1/1; D: Big_Real := 1 / 3; begin Put_Line (Boolean'(I=J)'Image); Put_Line (to_String (R)); Put_Line (Boolean'Image(R=S)); Put_Line (to_String (Numerator (S)) & to_String (Denominator (S))); Put_Line (to_String (D, Aft => 110)); Put_Line (to_String (Numerator (D)) & to_String (Denominator (D))); end Main;