Search Unity

Does int in Unity has limit?

Discussion in 'Scripting' started by ScamTheMan, Aug 1, 2020.

  1. ScamTheMan

    ScamTheMan

    Joined:
    Oct 4, 2018
    Posts:
    75
    Hello, just wondering if int in Unity has limits like in C where int is 32-bit and value stored in it must be below 2,147,483,647 and if you want more, you have to use long. If not does it have limit like long or bigger?
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,909
  3. ScamTheMan

    ScamTheMan

    Joined:
    Oct 4, 2018
    Posts:
    75
  4. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    Code (csharp):
    1.  
    2. Debug.Log(int.MaxValue);
    3.