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:13:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr14.news.prodigy.com.POSTED!3bae8248!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: float problem References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 67.115.104.230 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr14.news.prodigy.com 1026155568 ST000 67.115.104.230 (Mon, 08 Jul 2002 15:12:48 EDT) NNTP-Posting-Date: Mon, 08 Jul 2002 15:12:48 EDT Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: Q[R_PJONAJUMB_LY@BCBNWX@RJ_XPDLMN@GZ_GYO^JWTEPIB_NVUAH_[BL[\IRKIANGGJBFNJF_DOLSCENSY^U@FRFUEXR@KFXYDBPWBCDQJA@X_DCBHXR[C@\EOKCJLED_SZ@RMWYXYWE_P@\\GOIW^@SYFFSWHFIXMADO@^[ADPRPETLBJ]RDGENSKQQZN Date: Mon, 08 Jul 2002 19:12:48 GMT Xref: archiver1.google.com comp.lang.ada:26946 Date: 2002-07-08T19:12:48+00:00 List-Id: > ... but I was using Pascal (and a bit Delphi) > before, where there is no rounding in procedure "write". So it must print n decimal digits to correctly represent 1/2**n, e.g. a 4 byte IEEE float must print 23 digits. > BTW: is it possible to disable the rounding in "put"? Maybe with some > global boolean variable or someting (maybe a pragma). Look at the "Aft" parameter in Float_IO.Put You can specify how many digits you want printed to the right (or left) of the decimal point. You didn't say, so the compiler used Default_Aft. Your post showed 5 digits to the right, so Default_Aft must be 5, so Float'digits is 6 in your compiler. Thus all your calculations, and printing, were done to 6 digit accuracy. If you want something different from the defaults you will have to say so in your program. Defaults are a convencience, but they can also be a trap for the unwary.