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 Date: Sat, 02 Dec 2006 17:40:50 +0100 From: Gautier User-Agent: Thunderbird 1.5.0.8 (Windows/20061025) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Way to use Ada Mod function on floats? References: <1164987168.477589.240140@j44g2000cwa.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 81.62.187.236 X-Original-NNTP-Posting-Host: 81.62.187.236 Message-ID: <4571ac78_6@news.bluewin.ch> X-Trace: news.bluewin.ch 1165077624 81.62.187.236 (2 Dec 2006 17:40:24 +0100) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn14feed!worldnet.att.net!164.128.36.58!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news2.google.com comp.lang.ada:7783 Date: 2006-12-02T17:40:50+01:00 List-Id: 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 ? ______________________________________________________________ Gautier -- http://www.mysunrise.ch/users/gdm/index.htm Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!