<div dir="ltr"><div dir="ltr">On Fri, Jan 10, 2025 at 8:48 PM Charles Oliver Nutter <<a href="mailto:headius@headius.com">headius@headius.com</a>> wrote:</div><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>This pasted weirdly... but it doesn't matter because there's an additional flaw: it will reject *all* negative results because the high 64 bits will be non-zero.</div></div></div></blockquote><div><br></div><div>This version passes all my tests:</div><div><br></div>if ((high == 0 && low >= 0) // result is within [0, MAX]<br>        || (high == -1 && low < 0)) { // result is within [MIN, 0)<br>    return low;<br><div>} </div></div></div>