Integer, 64 Bit, signed and unsigned

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

    Integer, 64 Bit, signed and unsigned

    Hi,

    i'd like to use 64 Bit Integer values in Python,
    can anybody give me a hint on what are the limits
    in Python?

    Can i use signed and unsigned 64 Bit Integers?


    Thanks for hints,
    Torsten.

  • Christian von Essen

    #2
    Re: Integer, 64 Bit, signed and unsigned

    Torsten Mohr wrote:[color=blue]
    > Hi,
    >
    > i'd like to use 64 Bit Integer values in Python,
    > can anybody give me a hint on what are the limits
    > in Python?
    >
    > Can i use signed and unsigned 64 Bit Integers?
    >
    >
    > Thanks for hints,
    > Torsten.
    >[/color]

    Hi,

    I havn't tried it myself, since i don't own a 64-Bit processor, but

    and

    say, that you can use 64 bit integers in CPython, if your C compiller
    supports 64 bit integer. May also depend on your OS.

    But you have to read some groups in http://groups.google.com
    Just search for 'Python 64 bit'. This will give you a lot of results, I
    guess.


    I think many people here can give you further information

    Christian von Essen

    Comment

    • John Roth

      #3
      Re: Integer, 64 Bit, signed and unsigned


      "Torsten Mohr" <tmohr@s.netic. de> wrote in message
      news:c49t6n$4mh $1@schleim.qwe. de...[color=blue]
      > Hi,
      >
      > i'd like to use 64 Bit Integer values in Python,
      > can anybody give me a hint on what are the limits
      > in Python?
      >
      > Can i use signed and unsigned 64 Bit Integers?[/color]

      Yes and no. Python has unlimited precision long
      integers, so it should work without any special
      effort for most things.

      If you're trying to exploit truncation at the 64 bit
      mark, though, you'll have to do it yourself with
      tests.

      John Roth[color=blue]
      >
      >
      > Thanks for hints,
      > Torsten.
      >[/color]


      Comment

      • Peter Otten

        #4
        Re: Integer, 64 Bit, signed and unsigned

        Torsten Mohr wrote:
        [color=blue]
        > Hi,
        >
        > i'd like to use 64 Bit Integer values in Python,
        > can anybody give me a hint on what are the limits
        > in Python?
        >
        > Can i use signed and unsigned 64 Bit Integers?
        >
        >
        > Thanks for hints,
        > Torsten.[/color]
        [color=blue][color=green][color=darkred]
        >>> 10**100[/color][/color][/color]
        100000000000000 000000000000000 000000000000000 000000000000000 000000000000000 000000000000000 00000000000L

        As for signed integers, the sky's the limit :-)

        Peter

        Comment

        • beliavsky@aol.com

          #5
          Re: Integer, 64 Bit, signed and unsigned

          Arithmetic with 8-byte integers will be much faster when using Fortran
          and C++ compilers that directly support it, compared to Python, which
          resorts to infinite precision arithmetic when 4-byte integers cannot
          be used. Search for "speed integer*8" in this newsgroup -- there was a
          discussion in late Feb early March 2004.

          Torsten Mohr <tmohr@s.netic. de> wrote in message news:<c49t6n$4m h$1@schleim.qwe .de>...[color=blue]
          > Hi,
          >
          > i'd like to use 64 Bit Integer values in Python,
          > can anybody give me a hint on what are the limits
          > in Python?
          >
          > Can i use signed and unsigned 64 Bit Integers?
          >
          >
          > Thanks for hints,
          > Torsten.[/color]

          Comment

          • Garry Knight

            #6
            Re: Integer, 64 Bit, signed and unsigned

            In message <c49v0p$l1m$05$ 1@news.t-online.com>, Peter Otten wrote:
            [color=blue]
            > As for signed integers, the sky's the limit :-)[/color]

            Surely that's where you calculate pi...

            --
            Garry Knight
            garryknight@gmx .net ICQ 126351135
            Linux registered user 182025

            Comment

            Working...