comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Drummond <brian@shapes.demon.co.uk>
Subject: Re: Fixed-point question
Date: Sun, 28 Jun 2015 11:39:56 +0000 (UTC)
Date: 2015-06-28T11:39:56+00:00	[thread overview]
Message-ID: <mmomec$f9d$2@dont-email.me> (raw)
In-Reply-To: 876168sx28.fsf@theworld.com

On Sat, 27 Jun 2015 16:42:07 -0400, Bob Duff wrote:

> There's a rule somewhere that says the context has to provide the type
> of the result, so the compiler knows how much precision is needed.  E.g.
> you can say "X := Y * Z;" but not "X := Y * Z * W;".

A rule that surprised me when I first ran into it, but on a moment's 
reflection as a hardware guy, makes perfect sense. It forces you to 
specify the range and resolution of intermediate results, eliminating 
rounding and overflow surprises.

Once I rewrote an algorithm along the lines imposed by this rule, I could 
make it generic and instantiate it with any fixed or floating point type 
I wanted, to investigate its stability and accuracy (with the eventual 
intent of translating to a VHDL implementation using minimal hardware).

-- Brian


  reply	other threads:[~2015-06-28 11:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26 13:20 Fixed-point question Patrick Noffke
2015-06-26 16:56 ` Jeffrey R. Carter
2015-06-26 18:21   ` Patrick Noffke
2015-06-26 20:21     ` Anh Vo
2015-06-26 20:25     ` Jeffrey R. Carter
2015-06-27  2:55       ` Patrick Noffke
2015-06-26 23:14     ` Qun-Ying
2015-06-27  3:00       ` Patrick Noffke
2015-06-27  4:44         ` Jeffrey R. Carter
2015-06-27 17:59           ` Patrick Noffke
2015-06-27 18:38             ` Jeffrey R. Carter
2015-06-27 19:20               ` Bob Duff
2015-06-27 19:57                 ` Jeffrey R. Carter
2015-06-27 20:42                   ` Bob Duff
2015-06-28 11:39                     ` Brian Drummond [this message]
2015-06-29 13:28                     ` Patrick Noffke
2015-06-29 14:13                       ` Bob Duff
2015-06-27 23:41               ` Anh Vo
  -- strict thread matches above, loose matches on Subject: below --
1995-04-01  0:00 Garlington KE
1995-04-06  0:00 ` Robert Dewar
1995-04-07  0:00   ` Robert I. Eachus
1995-04-07  0:00     ` Robert Dewar
1995-04-07  0:00   ` Garlington KE
1995-04-07  0:00     ` Robert Dewar
replies disabled

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