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/29 Message-ID: <3842A11A.6833A317@easystreet.com>#1/1 X-Deja-AN: 554453931 Content-Transfer-Encoding: 7bit References: <383f6dbb.22609744@news.tstonramp.com> <81pvi5$sl1$1@nnrp1.deja.com> <38409C87.69EC865@easystreet.com> <81tue8$evd$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Trace: typ12.nn.bcandid.com 943890447 206.103.56.184 (Mon, 29 Nov 1999 10:47:27 EST) Organization: Trillium Resources Corporation MIME-Version: 1.0 NNTP-Posting-Date: Mon, 29 Nov 1999 10:47:27 EST Newsgroups: comp.lang.ada Date: 1999-11-29T00:00:00+00:00 List-Id: How about this one: --------------------------------------------------------- with Ada.Text_Io; procedure Money_Test is -- type money is delta 0.01 digits 10 range 0.0..10_000_000.00; type Money is delta 0.01 range 0.0 .. 10_000_000.00; -- package money_io is new ada.text_io.decimal_io(money); package Money_Io is new Ada.Text_Io.Fixed_Io(Money); F : Long_Float := 0.0300000000000000; begin Money_Io.Put(Money(F)); -- GNAT 3.12p Puts 0.03 Money_Io.Put(Money(0.0300000000000000)); -- GNAT 3.12p Puts 0.02 end Money_Test; ---------------------------------------------------------------- I suppose that 0.02 and 0.03 are each allowed, but I find the inconsistency a little unexpected. Al Robert Dewar wrote: > > In article <38409C87.69EC865@easystreet.com>, > Al Christians wrote: > > > No, the output should be 71.3, and this is what is expected. > > > > So, why does GNAT 3.12p give 68.55? > > > > Al > > > > That's also an allowed output value in this case! >