<div dir="auto">Makes sense, thank you!</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 5 Jun 2023 at 19:11 Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr">I replaced ALL sends, not just this one, because it's putting too much responsibility for senders for a very weak gain<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 5 juin 2023 à 19:09, Luciano Notarfrancesco <<a href="mailto:luchiano@gmail.com" target="_blank">luchiano@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="auto">Ah, good to know, you replaced all calls to \\\ with \\ in all methods or only this one? We should do the same in Cuis. Still, the randomness mystery remains…</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 5 Jun 2023 at 19:04 Nicolas Cellier via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="ltr"><div>Ah OK... I expunged the sends of \\\ operator from Squeak.<br></div><div>This is exactly like \\ but omits normalization of LargeInteger result...</div><div>Below is the comment that i let in \\\ definition:</div><div><br></div><div><br> "A modulo method former used in DSA."<br> <br> "Notes: this method used to be a faster than \\ for LargeIntegers, but this advantage is fainting:<br> - it always was slower for SmallInteger because of the indirection below<br> - a new LargeInteger primitive makes \\ faster up to 64 bits operands<br> - even above 64 bits, its advantage has become marginal thanks to revised \\ primitive fallback code<br> Moreover, \\\ behaviour is questionable for these reasons:<br> - for a negative receiver xor argument, it behaves like rem: for LargeInteger and \\ for SmallInteger<br> - it may answer a not normalized LargeInteger (with leading null digits) which breaks some invariants<br> For example, check (SmallInteger maxVal + 1 \\\ 8) isZero.<br> So beware if you ever think using this method."<br></div><br></div><br><div class="gmail_quote"></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 5 juin 2023 à 18:56, Luciano Notarfrancesco via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="auto">Doing</div><div dir="auto"> pow := pow * pow \\ m</div><div dir="auto">instead of</div><div dir="auto"> pow := pow * pow \\\ m</div><div dir="auto">at the beginning of the loop in Integer>>#slidingLeftRightRaisedTo:modulo: seems to fix it. But still I’m not sure why it is random otherwise, and I’m not sure that this really fixes the problem.</div><div dir="auto"><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 5 Jun 2023 at 18:42 Luciano Notarfrancesco <<a href="mailto:luchiano@gmail.com" target="_blank">luchiano@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div dir="auto">The following:</div> 5445648384 raisedTo: 3 modulo: 1 << 34<div dir="auto">Returns 0, which is right. But</div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)"> 5445648384 raisedTo: 4 modulo: 1 << 34</span><br></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)">Returns different numbers every time I call it (it should return 0).</span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)">It’s very weird… I don’t see where the randomness is coming from, perhaps from LargeIntegerPlugin?</span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)"><br></span></div><div dir="auto"><span style="border-color:rgb(0,0,0);color:rgb(0,0,0)"><br></span></div>
</blockquote></div></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div></div>
</blockquote></div>
</blockquote></div></div>