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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: getting same output as gfortran, long_float Date: Thu, 30 Apr 2015 15:12:56 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Thu, 30 Apr 2015 22:11:56 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="a3855fbfe1a666be9aefba0563039ed5"; logging-data="21890"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/J+0psT4qhC51gVJtaHIARi8Eb0KXuS6g=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: Cancel-Lock: sha1:8MdPBNjHJiKCCgk7wjyBuSMWxdQ= Xref: news.eternal-september.org comp.lang.ada:25668 Date: 2015-04-30T15:12:56-07:00 List-Id: On 04/30/2015 02:17 PM, Nasser M. Abbasi wrote: > > with ada.text_io; use ada.text_io; > procedure foo_2 is > x : Long_Long_Float; > begin > x := 12.0 * 0.0001/(1.0 * (1.0 - 0.1)**4 ); > put_line(Long_Long_Float'image(x)); > end foo_2; What do you get with this: With Ada.Text_IO; procedure Foo_However_Many is X : constant := 12.0 * 0.0001 / (1.0 * (1.0 - 0.1) ** 4); begin -- Foo_However_Many Ada.Text_IO.Put_Line (Item => X'Img); end Foo_However_Many; ? You probably can't get any more significant digits from GNAT than this gives you. You could also try a type defined as type Big is digits System.Max_Digits; -- Jeff Carter "Many times we're given rhymes that are quite unsingable." Monty Python and the Holy Grail 57