comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Multiplying fixed-point by long integer
Date: Thu, 4 Oct 2012 18:46:41 -0700 (PDT)
Date: 2012-10-04T18:46:41-07:00	[thread overview]
Message-ID: <b06c0b56-3f3c-42e9-8b3a-76a4a27fc1cc@googlegroups.com> (raw)

I don't think I've ever seen this problem discussed before ...

4.5.5 defines predefined multiplication operators between any fixed-point type and Integer.  However, it isn't defined for any other integer type.  This can cause a problem if I have an integer type whose bounds are larger than Integer, since it obviously won't work to convert it to Integer.  Has anyone encountered this problem before, and how did you solve it?  I'm hesitant to try to solve it by converting things to floating point, since the mantissa of a floating-point may have fewer bits than the fixed-point or integer type, and fixed-point multiplication by an integer should be exact.

                                 -- thanks, Adam



             reply	other threads:[~2012-10-05  1:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-05  1:46 Adam Beneschan [this message]
2012-10-05  2:12 ` Multiplying fixed-point by long integer Shark8
2012-10-05  4:23 ` Jeffrey Carter
2012-10-05  4:25 ` tmoran
2012-10-05 15:41   ` Adam Beneschan
2012-10-05  5:14 ` anon
2012-11-06 17:20 ` Jacob Sparre Andersen
2012-11-06 20:33   ` Adam Beneschan
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox