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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,3cff83f35107b37b,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.79.233 with SMTP id m9mr1774565pax.37.1349401601806; Thu, 04 Oct 2012 18:46:41 -0700 (PDT) Received: by 10.68.212.99 with SMTP id nj3mr2835530pbc.20.1349401601790; Thu, 04 Oct 2012 18:46:41 -0700 (PDT) Path: g9ni23679pbh.1!nntp.google.com!kr7no5072918pbb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 4 Oct 2012 18:46:41 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Multiplying fixed-point by long integer From: Adam Beneschan Injection-Date: Fri, 05 Oct 2012 01:46:41 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-10-04T18:46:41-07:00 List-Id: I don't think I've ever seen this problem discussed before ... 4.5.5 defines predefined multiplication operators between any fixed-point t= ype and Integer. However, it isn't defined for any other integer type. Th= is can cause a problem if I have an integer type whose bounds are larger th= an Integer, since it obviously won't work to convert it to Integer. Has an= yone encountered this problem before, and how did you solve it? I'm hesita= nt to try to solve it by converting things to floating point, since the man= tissa of a floating-point may have fewer bits than the fixed-point or integ= er type, and fixed-point multiplication by an integer should be exact. -- thanks, Adam