Results 1 to 4 of 4

Thread: Storing a 64-digit base-3 number inside of an int (Java)

  1. #1

    Storing a 64-digit base-3 number inside of an int (Java)

    If I have a 64-digit number in base-3, how do I put that inside of an int? I know that the number will be too big, but I'm not sure what happens when you go over the int limit (2,147,483,647)

  2. #2
    Join Date
    Oct 2006
    Location
    Ireland
    Beans
    416
    Distro
    Kubuntu 8.04 Hardy Heron

    Re: Storing a 64-digit base-3 number inside of an int (Java)

    Quote Originally Posted by souled View Post
    If I have a 64-digit number in base-3, how do I put that inside of an int? I know that the number will be too big, but I'm not sure what happens when you go over the int limit (2,147,483,647)
    It wraps back around, so for example "2147483647 + 1 == -2147483648".
    Saying that you "could care less" about something is implying that you DO care about it, regardless of common usage.
    Using it as a way of saying you don't care is simply wrong.

  3. #3
    Join Date
    Jun 2006
    Location
    The Netherlands
    Beans
    2,185
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Storing a 64-digit base-3 number inside of an int (Java)

    It depends on how you are putting it into an int exactly. It could just wrap around as happysmileman says. What code are you using to do this?
    Ubuntu 12.04

  4. #4

    Re: Storing a 64-digit base-3 number inside of an int (Java)

    I'm trying to generate a hash function. Since it wraps around, it won't be ideal. However I am allowed some leeway as to how many collisions I can have.

    Thanks.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •