comp.lang.ada
 help / color / mirror / Atom feed
From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!convex!sercely @ucbvax.Berkeley.EDU  (Ron Sercely)
Subject: Re: FIXED bug in Medidian 4.1.1?
Date: 28 Apr 93 14:32:17 GMT	[thread overview]
Message-ID: <1993Apr28.143217.26895@convex.com> (raw)

In article <A9YCBYKQ@math.fu-berlin.de> dww@math.fu-berlin.de (Debora Weber-Wul
ff) writes:
>I've been having lots of trouble with FIXED for Meridian 4.1.1 (DOS),
>and have been told that it is complicated, but this is downright
>silly:
>
>If I define two types like this
>
>type OKAY is delta 0.01 range 0.0 .. 3.0;
>type FLAKEY is delta 0.01 range 0.15 .. 3.0;
>
>and instantiate put and get procedures from FIXED_IO I can
>get any OKAY value without trouble. Trying to get any FLAKEY
>value between 0.15 and 0.99 results in the error
>Value 0 out of range 19 .. 384
>I can enter any value between 1.0 and 3.0 of type FLAKEY without
>trouble. It seems that the leading 0 causes problems if 0
>is not in the defined range.
>
>Debora Weber-Wulff
>
>-- 
>Debora Weber-Wulff, Professorin fuer Softwaretechnik
>snail: Technische Fachhochschule Berlin, FB Informatik, 
>       Luxemburgerstr. 10, 1000 Berlin 65
>email: dww@informatik.tfh-berlin.dbp.de 

I don't know "chapter and verse" on Meridian or fixed point numbers, but
suspect that you are seeing the following problem.

Fixed point numbers are internally represented with a delta this is a power of
2, unless a representation clause length clause is used to specify _small_.
What this means in your case, is that the internally generated delta is
0.0078125. (Which is 2**(-7), which is the largest power of 2 less than your
specified delta of 0.01).  Note also that 3/0.0078125=384, which your are
seeing in your error message.  The value 0.15 is not a model number,
specifically it is 19*0.0078125 + 0.0015625.  

I _suspect_ that the range is being converted to a range of the _model numbers_
which would mean that the minimum representable value is 0.15625.  Since
0.15 is less than that, the get is failing.  This is, I believe a bug.

Just to narrow things down, try things like:
 change the range,
 make both bounds model numbers,
 use the 'small attribute to set small to 0.01 and see if it helps.

I would warn you, fixed_io is often buggy with this kind of stuff.  Hope
this post helps.

Ron Sercely

             reply	other threads:[~1993-04-28 14:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-04-28 14:32 Ron Sercely [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-04-29 15:18 FIXED bug in Medidian 4.1.1? Robert Dewar
1993-04-30 10:33 Keith Thompson @pulsar
1993-05-02 11:59 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!ira.u
1993-05-03 13:50 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!noc.n
1993-05-04  4:05 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