<div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 28, 2018 at 4:54 PM David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sun, Oct 28, 2018 at 03:48:58PM -0700, Chris Cunningham wrote:<br>
> (keyboard failure)<br>
> On Sun, Oct 28, 2018 at 3:41 PM Chris Cunningham <<a href="mailto:cunningham.cb@gmail.com" target="_blank">cunningham.cb@gmail.com</a>><br>
> wrote:<br>
> <br>
> > Looking at LargeIntegers (I'm 64 bit, so these are big):<br>
> > {<br>
> > 1152921504606846977 digitCompare:  -1152921504606846977.<br>
> > 1152921504606846977 digitCompare:  -1152921504606846978.<br>
> > 1152921504606846978 digitCompare:  -1152921504606846977.<br>
> > }  "#(0 -1 1)"<br>
> ><br>
> > {<br>
> > 1249 digitCompare: -1249.<br>
> > 1249 digitCompare: -1250.<br>
> > 1250 digitCompare: -1249<br>
> ><br>
>  }   "#(1 1 1)"<br>
> <br>
> The method is actively different for SmallIntegers and LargeIntegers.<br>
> <br>
> I'm not sure how much this matters - besides the fact that it is lying<br>
> around waiting for someone to use it.  For comparisons of integers, the<br>
> callers check to see if one (or more) of the numbers are negative, then<br>
> handles the issues here.<br>
<br>
I would say that this is crying out for some unit tests :-)<br>
<br></blockquote><div>Yes, just need to figure out what the right results are. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> <br>
> It is also currently used in DateAndTime class methods (#nowWithOffset:<br>
> [deprecated] and #now:offset:), which is probably safe because now is<br>
> always after the epoch.  And we hopefully wouldn't use #now:withOffset: for<br>
> pre-epoch times.<br>
> <br>
> Is this worth fixing?<br>
> <br>
<br>
Definitely, yes.<br></blockquote><div>Good. Then this starts in</div><div>   LargeIntegerPlugin>>primDigitCompare:</div><div>with this nice comment:</div><div><span style="white-space:pre">     </span>"shortcut: aSmallInteger has to be smaller in Magnitude as aLargeInteger"</div><div> This has been there at least since 2004...<br></div><div><br></div><div>cross posting to the VM Dev list (since it should be handled there first).</div><div>I'd be happy to replicate the right answer in the fallback code, and craft tests, once the right behavior is explained.</div><div><br></div><div>Thanks,</div><div>cbc</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Dave<br>
<br>
<br>
</blockquote></div></div></div>