[Bug]arithmetic primitive Fails

Stephan Rudlof sr at evolgo.de
Sun Feb 6 23:32:42 UTC 2000


The quoFix.2.cs is a workaround. At least the comments in
SmallInteger>>// (prim 12) and SmallInteger>>quo: (prim 13) remain
wrong.
IMHO deeper thinking about this and similar problems is necessary: then
among other things preconditions of Integer>>
digitAdd:,digitDiv:,digitSub:,digitMul:, digitLogic:op:length: and when
to #normalize should be explained.

Stephan


Torge Husfeldt wrote:
> 
> Hi All,
> I found a bug in a more or less recent 2.8a (updates through #1789 vm 2.7
> build 8 from 01/15/2000) the primitive 12 (primitiveDiv) fails with no
> paricular reason other than that it can't deal with operating on only
> SmallInts and having to return a LargePositiveInteger in the following
> special case:
> 
> SmallInt minVal // -1
> which should retrun
> SmallInt minVal abs
> which is the same as
> SmallInt maxVal +1.
> 
> Since this is happening only with this special combination I think the
> solution is a simple test in case of primitive fail. Like in the attached
> cs.
> 
> Regards,
> Torge
> P.S.: In fact the call gets delegated to #quo: (primitiveQuo, 13) which also
> fails
> and that's the point where I inserted the test.
> 
>   ------------------------------------------------------------------------
>                   Name: quoFix.2.cs
>    quoFix.2.cs    Type: unspecified type (application/octet-stream)
>               Encoding: quoted-printable





More information about the Squeak-dev mailing list