title: C# BigInteger and int How to save memory?
body: <p>I am testing a matrix if it has a prime number in every line. </p>
  
  <p>The MR means that it should use the Miller Rabin algorithm. If its false it simply tries the divisors up to sqrt(n). Vansor is true if it has found a prime in every checked row, vanoszlop is true if it has found a prime in the actually checked row.</p>
  
  <p>My question is: Is it possible to save the memory by not creating both the int and BigInteger values only if the tryParse is true? I mean something like</p>
  
  <pre><code>if (int.tryParse(akt, out new int szam))
  </code></pre>
  
  <p>Is something like this possible? (and how much memory does a BigInteger take when its not signed?)</p>
  
  <pre><code>    akt = Console.ReadLine();
      int szam; BigInteger szambig;
  
      if (int.TryParse(akt, out szam))
      {
         if (MR)  {
            if (MilRab(szam))
            { vansor = true; vanoszlop = true; } }
  
            else if (Prim(szam))
            { vansor = true; vanoszlop = true; }
      }
      else if (BigInteger.TryParse(akt, out szambig))
      {
         if (MR) {
            if (MilRab(szam))
            { vansor = true; vanoszlop = true; } }
  
         else if (Prim(szam))
         { vansor = true; vanoszlop = true; }
      }
  </code></pre>