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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,319c841368a8705a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-08 12:28:44 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-post-02!supernews.com!corp.supernews.com!not-for-mail From: achrist@easystreet.com Newsgroups: comp.lang.ada Subject: Re: float problem Date: Mon, 08 Jul 2002 12:28:49 -0700 Organization: Posted via Supernews, http://www.supernews.com Message-ID: <3D29E7F1.183E543C@easystreet.com> X-Mailer: Mozilla 4.79 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:26947 Date: 2002-07-08T12:28:49-07:00 List-Id: Jan Prazak wrote: > > On Sun, 07 Jul 2002 13:08:01 -0100, Frank J. Lhota wrote: > > > The error is small enough to > > not affect the printed output, where things are rounded to six > > significant digits, ... > > Thanks, I didn't know that procedure "put" rounds given number. I have > just started to learn Ada, but I was using Pascal (and a bit Delphi) > before, where there is no rounding in procedure "write". > BTW: is it possible to disable the rounding in "put"? Maybe with some > global boolean variable or someting (maybe a pragma). If there was no rounding, then displaying a number with absolute value less than one would require 1 decimal digit to show each bit to the right of the decimal (or binary) point. Short floating point values (on typical hardware) in Ada or Pascal would require about 24 digits. Double precision values would require about 53 digits, and long double precision would require about 64 digits. The 'unrounded' values that you get from Pascal, etc, show the value to full precision, ie the rightmost digit shown is the one about where the effects of rounding and truncation error show up, depending on how much rounding and truncation has happened. Any digits beyond those shown are probably of questionable value at best, but that doesn't mean that there is no rounding to produce the output you see. Al