<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><br></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"Gavin Ray" <ray.gavin97@gmail.com><br><b>To: </b>"panama-dev" <panama-dev@openjdk.org><br><b>Sent: </b>Tuesday, July 4, 2023 9:54:06 PM<br><b>Subject: </b>Vector API "FizzBuzz", how-to without "REM" or "URSHIFT" operator?<br></blockquote></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr">I got curious about writing a simple FizzBuzz program with the Vector API as a learning exercise<br><div>I realized that there appears to be no operator supporting modulo/remainder.</div><div>Is it possible to emulate modulo with a composition of other operators?</div></div></blockquote><div><br></div><div>You don't need it,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>For representing Fizz, Buzz or FizzBuzz, the idea is to use -1, -2 and -3 so every values is an int.</div><div>Then you do not need a modulo because you can compute the first 15 values, and then adds 15 to the next 15 values that are not Fizz, Buzz or FizzBuzz (so that are not a negative value).</div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div dir="ltr"><br><div>Thank you =)</div></div></blockquote><div><br></div><div>regards,<br data-mce-bogus="1"></div><div>Rémi<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div></div></div></body></html>