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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no 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 11:11:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!oleane.net!oleane!teaser.fr!enst!enst.fr!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: float problem Date: Mon, 8 Jul 2002 13:10:36 -0500 Organization: ENST, France Sender: comp.lang.ada-admin@ada.eu.org Message-ID: References: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1026151863 38789 137.194.161.2 (8 Jul 2002 18:11:03 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Mon, 8 Jul 2002 18:11:03 +0000 (UTC) Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: comp.lang.ada mail<->news gateway List-Unsubscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Original-Cc: janp9@gmx.net Xref: archiver1.google.com comp.lang.ada:26944 Date: 2002-07-08T13:10:36-05:00 It is impossible for _any_ computer language or compiler to _not_ round when converting to machine representation to decimal representation, unless the machine representation is decimal -- something that no modern machine does. This is because only certain decimal values are _exactly_ representable in binary. For example 0.1 is not exactly representable in binary, but values like 0.125, 0.375, etc. are exactly representable. The issue, then, is the _degree_ of rounding that is done. In the case of the Ada type Float, most compilers use that type for 32-bit floating point, while 64-bit floating point is implemented with the type Long_Float. ----- Original Message ----- From: "Jan Prazak" Newsgroups: comp.lang.ada To: Sent: Monday, July 08, 2002 3:20 PM Subject: Re: float problem > 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). > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >