Loading ...
Sorry, an error occurred while loading the content.

Re: [langsmiths] BigInt library

Expand Messages
  • Matthew O'Connor
    ... Interestingly there s been a discussion on caml-list about using 64 bit ints for doing money. With precision to the 1/1000th and using Vietnamese Dongs
    Message 1 of 14 , Feb 21, 2006
    • 0 Attachment
      James McCartney wrote:
      > On Feb 15, 2006, at 7:23 AM, Chuck Esterbrook wrote:
      >
      >> On 2/15/06, Rudla Kudla <rudla@...> wrote:
      >>> I'm planning to implement arbitrary precision integers into my
      >>> language.
      >>> I explored several libraries implementing such functionality, but I
      >>> cannot decide, which one to use.
      >> Why are people so fascinated with arbitrary precision integers? Please
      >> don't take this as a criticism; I'm genuinely curious.
      >>
      >> Do you ever overflow 32 bit ints in actual programs? If so, would you
      >> also overflow 64 ints? If so, what kind of work do you do?
      >
      > 18 quintillion integers ought to be enough for anyone! :-)

      Interestingly there's been a discussion on caml-list about using 64 bit
      ints for doing money. With precision to the 1/1000th and using
      Vietnamese Dongs will only provide one order of magnitude of safety when
      representing the world's GDP (ie. max signed int64 ~ 1e18, world GDP in
      Dongs ~ 1e17). Point being, money is an area where arbitrary precision
      ints would be a good thing.


      Matt

      [note from moderator - this message was delayed because I missed the moderation request - sorry]
    • Chuck Esterbrook
      ... According to http://en.wikipedia.org/wiki/Vietnamese_dong: As of November 9, 2005, the US dollar was worth 15,897 đồng. Given the size of the world s
      Message 2 of 14 , Mar 9, 2006
      • 0 Attachment
        On 2/21/06, Matthew O'Connor <angagon@...> wrote:
        > James McCartney wrote:
        > > On Feb 15, 2006, at 7:23 AM, Chuck Esterbrook wrote:
        > >
        > >> On 2/15/06, Rudla Kudla <rudla@...> wrote:
        > >>> I'm planning to implement arbitrary precision integers into my
        > >>> language.
        > >>> I explored several libraries implementing such functionality, but I
        > >>> cannot decide, which one to use.
        > >> Why are people so fascinated with arbitrary precision integers? Please
        > >> don't take this as a criticism; I'm genuinely curious.
        > >>
        > >> Do you ever overflow 32 bit ints in actual programs? If so, would you
        > >> also overflow 64 ints? If so, what kind of work do you do?
        > >
        > > 18 quintillion integers ought to be enough for anyone! :-)
        >
        > Interestingly there's been a discussion on caml-list about using 64 bit
        > ints for doing money. With precision to the 1/1000th and using
        > Vietnamese Dongs will only provide one order of magnitude of safety when
        > representing the world's GDP (ie. max signed int64 ~ 1e18, world GDP in
        > Dongs ~ 1e17). Point being, money is an area where arbitrary precision
        > ints would be a good thing.

        According to http://en.wikipedia.org/wiki/Vietnamese_dong:
        As of November 9, 2005, the US dollar was worth 15,897 đồng.

        Given the size of the world's GDP, I don't think using the dong would
        be a requirement or even recommended. A Vietnamese programmer could
        use units of 100,000 dong which still gives a resolution of about 6
        U.S. dollars.

        Also, what percentage of programmers world-wide (1) need to represent
        the world's GDP, (2) have to do it with dongs and (3) could not live
        with the resolution provided by 100,000 dongs? I think the answer is
        0%.

        For money, I like the decimal type from C#. It supports decimal places
        "out of the box" and is reasonably fast. I think it's 128 bits, not
        64, but then this thread was originally about ints, not fractionals.

        -Chuck
      • Chuck Esterbrook
        ... So is this list moderated message by message? Were there problems before with spam or flame wars? Just curious, Chuck
        Message 3 of 14 , Mar 9, 2006
        • 0 Attachment
          > [note from moderator - this message was delayed because I missed the moderation request - sorry]

          So is this list moderated message by message? Were there problems
          before with spam or flame wars?

          Just curious,
          Chuck
        • Steve Dekorte
          ... Only the first post by a new member is moderated. Based on that post I either ban the member (if it s span) or approve the message and turn off moderation
          Message 4 of 14 , Mar 9, 2006
          • 0 Attachment
            On 9 Mar 2006, at 09:11 am, Chuck Esterbrook wrote:
            >> [note from moderator - this message was delayed because I missed the
            >> moderation request - sorry]
            >
            > So is this list moderated message by message? Were there problems
            > before with spam or flame wars?

            Only the first post by a new member is moderated. Based on that post I
            either ban the member (if it's span) or approve the message and turn
            off moderation for that member.

            -- Steve
          • Chuck Esterbrook
            ... Makes sense. Thanks for the info. -Chuck
            Message 5 of 14 , Mar 9, 2006
            • 0 Attachment
              On 3/9/06, Steve Dekorte <steve@...> wrote:
              >
              > On 9 Mar 2006, at 09:11 am, Chuck Esterbrook wrote:
              > >> [note from moderator - this message was delayed because I missed the
              > >> moderation request - sorry]
              > >
              > > So is this list moderated message by message? Were there problems
              > > before with spam or flame wars?
              >
              > Only the first post by a new member is moderated. Based on that post I
              > either ban the member (if it's span) or approve the message and turn
              > off moderation for that member.

              Makes sense. Thanks for the info.

              -Chuck
            Your message has been successfully submitted and would be delivered to recipients shortly.