comp.lang.ada
 help / color / mirror / Atom feed
From: Anh Vo <anhvofrcaus@gmail.com>
Subject: Re: Fixed-point question
Date: Sat, 27 Jun 2015 16:41:18 -0700 (PDT)
Date: 2015-06-27T16:41:18-07:00	[thread overview]
Message-ID: <de018629-34ac-44d1-ab27-eff33b38cc61@googlegroups.com> (raw)
In-Reply-To: <mmmqft$sh8$1@dont-email.me>

On Saturday, June 27, 2015 at 11:38:11 AM UTC-7, Jeffrey R. Carter wrote:
> On 06/27/2015 10:59 AM, Patrick Noffke wrote:
> > On Friday, June 26, 2015 at 11:44:07 PM UTC-5, Jeffrey R. Carter wrote:
> >>
> >> With a small of 1/180:
> >>
> >> For C1, AFAICT, the compiler will calculate N/D exactly, getting 44/3 =
> >> 14.6666...., and then convert this to Fixed_type, getting 2640/180.
> >>
> >> For C2, "/" for Fixed_Type is used, so N and D are converted to Fixed_Type
> >> first. 
> > 
> > My question is whether this is the right thing for the compiler to do.
> 
> For C2, definitely. I'm not sure why the type conversion for C1 results in using
> the universal-real operator. 

Because N and D are universal-real. In fact, if N and D are declared as Fixed_Type, C1 and C2 have the same value.

Anh Vo

  parent reply	other threads:[~2015-06-27 23:41 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
2015-06-29 13:28                     ` Patrick Noffke
2015-06-29 14:13                       ` Bob Duff
2015-06-27 23:41               ` Anh Vo [this message]
  -- 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