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,b5ada130a6506d9a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-20 15:19:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!freenix!enst!enst.fr!not-for-mail From: "David C. Hoos" Newsgroups: comp.lang.ada Subject: Re: rounding floating point numbers Date: Wed, 20 Feb 2002 17:24:21 -0600 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 1014247142 97779 137.194.161.2 (20 Feb 2002 23:19:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 20 Feb 2002 23:19:02 +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.8 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 Xref: archiver1.google.com comp.lang.ada:20185 Date: 2002-02-20T17:24:21-06:00 Bear in mind that floating point numbers cannot exactly represent fractional decimal values, unless the fractional part happens to be an integer multiple of a negative integer power of 2 -- e.g. 0.5, 0.25, 0.75, etc. Further, the maximum number of digits approximately expressible in floating point representation is constrained by the declaration of the floating point type -- e.g., type My_Float is digits 6; Are you sure you want to use floating point? Have you considered decimal Fixed_Point types? ----- Original Message ----- From: "Fraz" Newsgroups: comp.lang.ada To: Sent: Wednesday, February 20, 2002 4:17 PM Subject: rounding floating point numbers > Hi > > How do i round a floating number to 2 decimal places? I know u can use > Fore, Aft, Exp in the PUT command, but i want to pass the number as > a paramater to something else, but i only want it to 2 decimal places? is > there a way to store the number like this in a variable? > > Fraz > > > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada.eu.org > http://ada.eu.org/mailman/listinfo/comp.lang.ada >