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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,b3e361752e757bb8 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.90.37 with SMTP id bt5mr3446275pab.40.1350569062677; Thu, 18 Oct 2012 07:04:22 -0700 (PDT) Received: by 10.68.230.33 with SMTP id sv1mr5444455pbc.18.1350569062621; Thu, 18 Oct 2012 07:04:22 -0700 (PDT) Path: s9ni21683pbb.0!nntp.google.com!kt20no3542684pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 18 Oct 2012 07:04:22 -0700 (PDT) In-Reply-To: <422cd822-6d9a-4909-9009-995d845180b8@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.20.190.126; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 69.20.190.126 References: <422cd822-6d9a-4909-9009-995d845180b8@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Fixed Point number mul, is it a bug? From: Shark8 Injection-Date: Thu, 18 Oct 2012 14:04:22 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-10-18T07:04:22-07:00 List-Id: Try: Package FP is Type Fixed is delta 0.01 range 0.00 .. 99.99; Private For Fixed'Small use 0.01; End FP; Then: Declare use type FP.Fixed; X : FP.Fixed:= 0.01; Begin For index in 1..5 loop x := x * 2; Ada.Text_IO.Put_Line( "x =>" & X'Img ); end loop; End; Yields: x => 0.02 x => 0.04 x => 0.08 x => 0.16 x => 0.32 (I'm using GNAT on a Windows/AMD.)