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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cb3f9900b9cf2da6 X-Google-Attributes: gid103376,public From: ucaa2385@alpha1.csv.ica.uni-stuttgart.de (Peter Hermann) Subject: Re: Truncation of FLOAT values Date: 1996/04/19 Message-ID: <4l80u7$1de2@info4.rus.uni-stuttgart.de>#1/1 X-Deja-AN: 148370769 references: <4l5nmq$fhv@inrou.erno.de> <4l6bjn$b96@cliffy.lfwc.lockheed.com> organization: Comp.Center (RUS), U of Stuttgart, FRG newsgroups: comp.lang.ada Date: 1996-04-19T00:00:00+00:00 List-Id: Cordes MJ (l117593@cliffy.lfwc.lockheed.com) wrote: : Franz Kruse (Franz.Kruse@erno.de) wrote: : : Is there a simple way in Ada 83 to determine the integer part or the fraction part : : of a FLOAT value? : : A conversion to INTEGER cannot be used, because it rounds. : If your compiler rounds, then you can simply add 0.5 to the FLOAT value : prior to converting it an INTEGER. You get the fractional part by : converting the result back to FLOAT and subtracting it from the : original FLOAT value. I am looking into LRM A.5.3(18-62) Why not using such attributes like fraction, compose,floor,ceiling,etc. etc. ? -- Peter Hermann Tel:+49-711-685-3611 Fax:3758 ph@csv.ica.uni-stuttgart.de Pfaffenwaldring 27, 70569 Stuttgart Uni Computeranwendungen Team Ada: "C'mon people let the world begin" (Paul McCartney)