470,821 Members | 1,995 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,821 developers. It's quick & easy.

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.

Jul 18 '05 #1
5 8126
Torsten Mohr wrote:
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.


Hi,

I havn't tried it myself, since i don't own a 64-Bit processor, but
http://groups.google.de/groups?hl=de...com%26rnum%3D1
and
http://groups.google.de/groups?hl=de...com%26rnum%3D2
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
Jul 18 '05 #2

"Torsten Mohr" <tm***@s.netic.de> wrote in message
news:c4**********@schleim.qwe.de...
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?
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

Thanks for hints,
Torsten.

Jul 18 '05 #3
Torsten Mohr wrote:
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.

10**100

10000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000 0L

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

Peter
Jul 18 '05 #4
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 <tm***@s.netic.de> wrote in message news:<c4**********@schleim.qwe.de>...
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.

Jul 18 '05 #5
In message <c4*************@news.t-online.com>, Peter Otten wrote:
As for signed integers, the sky's the limit :-)


Surely that's where you calculate pi...

--
Garry Knight
ga*********@gmx.net ICQ 126351135
Linux registered user 182025
Jul 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by David Fisher | last post: by
10 posts views Thread by Peter Piper | last post: by
14 posts views Thread by junky_fellow | last post: by
21 posts views Thread by Frederick Gotham | last post: by
11 posts views Thread by Frederick Gotham | last post: by
2 posts views Thread by Frederick Gotham | last post: by
7 posts views Thread by Spoon | last post: by
88 posts views Thread by santosh | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.