title: Is there a zero constant in the GMP library?
body: <p>In a program, I have to check whether a certain number is equal to zero. One way to do it is to just initialise an <code>mpz_t</code> and check whether the original number equals it. But surely there is a zero constant in GMP, like <code>BigInteger.ZERO</code> in Java &amp; Kotlin?</p>
  <p>(Somehow <a href="https://gmplib.org/manual/Useful-Macros-and-Constants" rel="nofollow noreferrer">this</a> page doesn't contain what I want; I did &quot;check the fine manual&quot; &amp; use a search engine, for those of you who adhere to the standard level of politeness on this page.)</p>
  <p>Thank you very much in advance!</p>
  <p>EDIT: I just learned that one may compare an mpz_t to an integer, so that one may do something like <code>mpz_cmp_ui(variable, 0) == 0</code>. The solutions given by the answer by Marc Glisse are probably even faster.</p>