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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8fce73be1b24ff29 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!solnet.ch!solnet.ch!news.clara.net!wagner.news.clara.net!pe1.news.blueyonder.co.uk!blueyonder!fe1.news.blueyonder.co.uk.POSTED!53ab2750!not-for-mail Reply-To: "Candida Ferreira" From: "Candida Ferreira" Newsgroups: comp.lang.ada References: <1n90xfycs8ygs$.a2i8smdqp0t0$.dlg@40tude.net> Subject: Re: C fmod function Organization: Gepsoft X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-ID: Date: Wed, 12 Apr 2006 19:38:55 GMT NNTP-Posting-Host: 82.40.160.130 X-Trace: fe1.news.blueyonder.co.uk 1144870735 82.40.160.130 (Wed, 12 Apr 2006 20:38:55 BST) NNTP-Posting-Date: Wed, 12 Apr 2006 20:38:55 BST Xref: g2news1.google.com comp.lang.ada:3804 Date: 2006-04-12T19:38:55+00:00 List-Id: I was finally able to test it and Ada's Remainder is not the same as C++ fmod. C++ fmod can be expressed by the generic form fMod(x,y) = ((x / y) - (Sign(x / y) * Floor(Abs(x / y)))) * y. Candida "Candida Ferreira" wrote in message news:kk9%f.233449$zk4.160702@fe3.news.blueyonder.co.uk... > Dmitry A. Kazakov wrote: >>> Is there in Ada a built-in function equivalent to the fmod function in >>> C++? >> >> Yes. See Annex A.5.3, Remainder attribute defined for floating-point >> types. > > Thanks, Dmitry. I was aware of the Remainder attribute, but having read > the definition I wasn't sure if it corresponded exactly to the C++ fmod > function which can be represented by the generic expression fMod(x,y) = > ((x / y) - (Sign(x / y) * Floor(Abs(x / y)))) * y. > > Best wishes, > Candida > > --- > Candida Ferreira, Ph.D. > Chief Scientist, Gepsoft > http://www.gene-expression-programming.com/author.asp > > GEP: Mathematical Modeling by an Artificial Intelligence > (Springer Verlag edition 2006) > http://www.gene-expression-programming.com/Books/index.asp > Online Version: > http://www.gene-expression-programming.com/GepBook/Introduction.htm > > Modeling Software: > http://www.gepsoft.com/ > >