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!news3.google.com!news.glorb.com!proxad.net!proxad.net!194.117.148.138.MISMATCH!pe2.news.blueyonder.co.uk!blueyonder!pe1.news.blueyonder.co.uk!blueyonder!fe3.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; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Message-ID: Date: Wed, 12 Apr 2006 15:49:36 GMT NNTP-Posting-Host: 82.40.160.130 X-Trace: fe3.news.blueyonder.co.uk 1144856976 82.40.160.130 (Wed, 12 Apr 2006 16:49:36 BST) NNTP-Posting-Date: Wed, 12 Apr 2006 16:49:36 BST Xref: g2news1.google.com comp.lang.ada:3794 Date: 2006-04-12T15:49:36+00:00 List-Id: 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/