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,f62cfcf04b0e1759 X-Google-Attributes: gid103376,public From: ica2ph@alpha1.csv.ica.uni-stuttgart.de (Peter Hermann) Subject: Re: Help: Truncating Decimal Types Date: 1998/01/02 Message-ID: <68iaav$rbi@info4.rus.uni-stuttgart.de>#1/1 X-Deja-AN: 312079767 References: <34A9138E.41C67EA6@swl.msd.ray.com> Organization: Comp.Center (RUS), U of Stuttgart, FRG Newsgroups: comp.lang.ada Date: 1998-01-02T00:00:00+00:00 List-Id: Robert Dewar (dewar@merv.cs.nyu.edu) wrote: > John asks > < number - short of writing a function? Seems Ada should allow this (and > other attributes) for fixed and decimal types, but it doesn't without > first converting the value to decimal. > >> > > This is trivial, just convert it to a decimal type whose delta is 1.0. > The default for such conversions is truncation. This is indeed new to me. It seems I have to change my mind. I always thought that the Ada rule is most easily rememberable in that -- conversions will round, -- integer divisions will truncate. puzzled -- 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)