Overload Operator to make unlimited size integer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cxcodexc

    Overload Operator to make unlimited size integer

    I am trying to overload the +, *, and - operators using variables of
    type int but allowing them to hold unlimited size. Can anyone help me
    do this?

    thanks
  • David White

    #2
    Re: Overload Operator to make unlimited size integer

    "cxcodexc" <CxCodexc@hotma il.com> wrote in message
    news:a3ba06e4.0 311272000.75791 fad@posting.goo gle.com...[color=blue]
    > I am trying to overload the +, *, and - operators using variables of
    > type int but allowing them to hold unlimited size. Can anyone help me
    > do this?[/color]

    I don't understand. Say you have a 32-bit int. There are 2^32 different bit
    patterns that it can be, so there are 2^32 different values that it can
    have. You can map those patterns to any values you like, but you can't have
    any more of them.

    DW



    Comment

    • Elie Nader

      #3
      Re: Overload Operator to make unlimited size integer


      "cxcodexc" <CxCodexc@hotma il.com> wrote in message
      news:a3ba06e4.0 311272000.75791 fad@posting.goo gle.com...[color=blue]
      > I am trying to overload the +, *, and - operators using variables of
      > type int but allowing them to hold unlimited size. Can anyone help me
      > do this?
      >
      > thanks[/color]
      of type "int" that holds unlimited size?....uh?... ..really?....in C++ !!! i
      doubt about that...

      NO SOLUTION..


      Eliahooo


      Comment

      • Gianni Mariani

        #4
        Re: Overload Operator to make unlimited size integer

        cxcodexc wrote:[color=blue]
        > I am trying to overload the +, *, and - operators using variables of
        > type int but allowing them to hold unlimited size. Can anyone help me
        > do this?
        >
        > thanks[/color]

        see:





        Comment

        • cxcodexc

          #5
          Re: Overload Operator to make unlimited size integer

          Gianni Mariani <gi2nospam@mari ani.ws> wrote in message news:<bq73uc$s9 0@dispatch.conc entric.net>...[color=blue]
          > cxcodexc wrote:[color=green]
          > > I am trying to overload the +, *, and - operators using variables of
          > > type int but allowing them to hold unlimited size. Can anyone help me
          > > do this?
          > >
          > > thanks[/color]
          >[/color]


          So say i have two integer variables both holding 200,000 if i
          mulptiply these and store the new value in another integer variable it
          will not hold the result. As the result is too big. I want to extend
          this integer variable type to hold any size. I heard i had to use and
          array of integers and a pointer or something along those lines

          Any ideas??

          Comment

          • Victor Bazarov

            #6
            Re: Overload Operator to make unlimited size integer

            "cxcodexc" <CxCodexc@hotma il.com> wrote...[color=blue]
            > [...]
            > So say i have two integer variables both holding 200,000 if i
            > mulptiply these and store the new value in another integer variable it
            > will not hold the result. As the result is too big. I want to extend
            > this integer variable type to hold any size. I heard i had to use and
            > array of integers and a pointer or something along those lines
            >
            > Any ideas??[/color]

            Do you know how to use a search engine? Try www.google.com and
            search for "arbitrary size integer implementation" (without the
            quotes, of course).

            Victor


            Comment

            • Gianni Mariani

              #7
              Re: Overload Operator to make unlimited size integer

              cxcodexc wrote:[color=blue]
              > Gianni Mariani <gi2nospam@mari ani.ws> wrote in message news:<bq73uc$s9 0@dispatch.conc entric.net>...
              >[color=green]
              >>cxcodexc wrote:
              >>[color=darkred]
              >>>I am trying to overload the +, *, and - operators using variables of
              >>>type int but allowing them to hold unlimited size. Can anyone help me
              >>>do this?
              >>>
              >>>thanks[/color]
              >>[/color]
              >
              >
              > So say i have two integer variables both holding 200,000 if i
              > mulptiply these and store the new value in another integer variable it
              > will not hold the result. As the result is too big. I want to extend
              > this integer variable type to hold any size. I heard i had to use and
              > array of integers and a pointer or something along those lines
              >
              > Any ideas??[/color]

              There are at least 3 C++ libraries I know of that will do what you want.
              The most "advanced" I think is GMP. Did you try it out ?


              Comment

              Working...