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-Thread: 103376,fc647120984c9ad2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Sat, 02 Dec 2006 19:05:07 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1164987168.477589.240140@j44g2000cwa.googlegroups.com> <4571ac78_6@news.bluewin.ch> Subject: Re: Way to use Ada Mod function on floats? Date: Sat, 2 Dec 2006 19:05:41 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-yPWSD0koMnOg4RAm6TqXVv+H3Y/8sw9yTIs0dCVmUtNfU8j74Jm0vd+630c0xwgPdYmTpwCeMU/6nVq!y4tlio3dMolKw05gMUGl4UxEFxpwwK3ef7kVU15/2KlMWuUSD2cGI3+iviI50y2lHkmelaqPkLCe!rE6dtUI6vsbX/w== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:7789 Date: 2006-12-02T19:05:41-06:00 List-Id: "Gautier" wrote in message news:4571ac78_6@news.bluewin.ch... > Stephen Leake: > > > SAL (http://stephe-leake.org/ada/sal.html) has: > > > > function Modulo (Dividend, Divisor : in Real_Type) return Real_Type > > is > > -- match names in Ada LRM 4.5.5 > > > > A : Real_Type renames Dividend; > > B : Real_Type renames Divisor; > > N : constant Integer := Integer (Real_Type'Floor (A / B)); > > begin > > return A - B * Real_Type (N); > > end Modulo; > > Out of curiosity, what is the need of converting Real_Type'Floor (A / B) to an > Integer and back to a Real_Type ? He just wanted to get Constraint_Error sometimes (esp. on Janus/Ada, where Integer is 16 bits!). ;-) Randy.