From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 28 Apr 93 14:32:17 GMT 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? Message-ID: <1993Apr28.143217.26895@convex.com> List-Id: In article 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