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,b257fba0affa289 X-Google-Attributes: gid103376,public From: Al Christians Subject: Re: fixed type (delta) in ada Date: 1999/11/27 Message-ID: <38409C87.69EC865@easystreet.com>#1/1 X-Deja-AN: 553936800 Content-Transfer-Encoding: 7bit References: <383f6dbb.22609744@news.tstonramp.com> <81pvi5$sl1$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: typ11.nn.bcandid.com 943758209 206.102.3.3 (Sat, 27 Nov 1999 22:03:29 EST) Organization: Trillium Resources Corporation MIME-Version: 1.0 NNTP-Posting-Date: Sat, 27 Nov 1999 22:03:29 EST Newsgroups: comp.lang.ada Date: 1999-11-27T00:00:00+00:00 List-Id: Robert Dewar wrote: > > In article <383f6dbb.22609744@news.tstonramp.com>, > nap@nobody.com (Nap) wrote: > > does anyone know why mutiplication between fixed type in ada > produce a > > big round off error? > > > > type money is delta 0.01 range 0.0..100_000_000.00; > > a, b, c : money; > > > > package money_io is new ada.text_io.fixed_io(money); > > > > a := 351.00; > > b := 0.20; > > c := a * b; > > > > money_io.put(c); > > > > -- the output should be 70.2 but it prints 71.3 instead. > > -- this is so frustrating. typecasting (back to float) doesn't > help > > either. > > No, the output should be 71.3, and this is what is expected. So, why does GNAT 3.12p give 68.55? Al