Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    Integer size and large integer parsing

    Bug Reporting (FUZE 4 Nintendo Switch)
    2
    4
    191
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z-Mann
      Z-Mann last edited by

      So I was wondering about how much data can be stuffed in an int, mostly to find a large magic value I could use that cannot possibly be a valid array index (well; other experiments show that value may as well be assumed to be 1000000...) I could not find anything in the documentation, so I experimented.

      The result is that calculations and output support 64 bit signed integers fine, but input only seems to go to 32 bit.

      int INT_MIN = (-1) << 63
      int INT_MAX = -(INT_MIN-1)
      

      get correctly printed as min and max signed 64 bit values, but the corresponding hexadecimal or decimal representations

      int INT_MIN = +/- 0x8000000000000000
      int INT_MAX =     0x7fffffffffffffff
      

      get cullet to +/- 1.

      I'm not really interested in getting the parsing to work :) That would be a bonus, but absolute low priority. I just want to state that yes, please, keep them 64 bit.

      1 Reply Last reply Reply Quote 1
      • spikey
        spikey F last edited by spikey

        @Z-Mann you can assign a number that use 64 bit if you use a = int(big number). Your tests are very illustrative, thanks. For another discussion, have a look at this https://fuzearena.com/forum/post/13231 if you like.

        1 Reply Last reply Reply Quote 1
        • Z-Mann
          Z-Mann last edited by

          Ah, thanks, I'll keep that in mind if I ever need specific big numbers. I would have used 12345*100000+67890 or something. I'm wondering now how int() works if the plain number doesn't...

          spikey 1 Reply Last reply Reply Quote 0
          • spikey
            spikey F @Z-Mann last edited by spikey

            @Z-Mann First I thought its how the parser interprets plain numbers, but because it works for int() it must be the implementation of the operator =. - Well, I guess everyone got bored to sleep after "First I thought". 😶

            1 Reply Last reply Reply Quote 0
            • First post
              Last post