title: What is the function to get the quotient and remainder (DIVMOD) for rust?
body: <p>x86 and likely other architectures provide a method to get the quotient and remainder in a <a href="https://www.felixcloutier.com/x86/div" rel="noreferrer">single operation (<code>DIV</code>)</a>. Because of this many languages have a DIVMOD combined operation, (like <a href="https://docs.microsoft.com/en-us/dotnet/api/system.math.divrem?redirectedfrom=MSDN&amp;view=net-5.0#System_Math_DivRem_System_Int32_System_Int32_System_Int32__" rel="noreferrer"><code>DIVREM</code> in C#</a>, <a href="https://www.w3schools.com/python/ref_func_divmod.asp" rel="noreferrer"><code>DIVMOD</code> in Python</a>, or with <a href="https://linux.die.net/man/3/div" rel="noreferrer"><code>div</code> and <code>div_t</code> in C</a>. How can I do this in Rust?</p>
  <p>Is there an optimized method to perform both</p>
  <pre class="lang-rust prettyprint-override"><code>let res = (a / b, a % b);
  </code></pre>