[vwrap] Python integer types (was: The <embed> tag... is the group still interested in LLSD or DSD?)

Boroondas Gupte <sllists@boroon.dasgupta.ch> Sat, 07 May 2011 15:14 UTC

Return-Path: <sllists@boroon.dasgupta.ch>
X-Original-To: vwrap@ietfa.amsl.com
Delivered-To: vwrap@ietfa.amsl.com
Received: from localhost (localhost []) by ietfa.amsl.com (Postfix) with ESMTP id 62E26E072E for <vwrap@ietfa.amsl.com>; Sat, 7 May 2011 08:14:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.387
X-Spam-Status: No, score=-1.387 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_MISMATCH_NET=0.611, HTML_MESSAGE=0.001, J_CHICKENPOX_36=0.6]
Received: from mail.ietf.org ([]) by localhost (ietfa.amsl.com []) (amavisd-new, port 10024) with ESMTP id is18ITlKhn8J for <vwrap@ietfa.amsl.com>; Sat, 7 May 2011 08:14:09 -0700 (PDT)
Received: from datendelphin.net (india288.server4you.de []) by ietfa.amsl.com (Postfix) with ESMTP id E2479E06C5 for <vwrap@ietf.org>; Sat, 7 May 2011 08:14:08 -0700 (PDT)
Received: from [] (adsl-89-217-134-70.adslplus.ch []) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by datendelphin.net (Postfix) with ESMTPSA id 793FB2E045 for <vwrap@ietf.org>; Sat, 7 May 2011 17:17:35 +0200 (CEST)
Message-ID: <4DC561BC.3040309@boroon.dasgupta.ch>
Date: Sat, 07 May 2011 17:14:04 +0200
From: Boroondas Gupte <sllists@boroon.dasgupta.ch>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110503 Lightning/1.0b3pre Thunderbird/3.1.10
MIME-Version: 1.0
To: vwrap@ietf.org
References: <BANLkTi=g9T5q5bVgytpxRxuE=Oc9iG2F9w@mail.gmail.com> <4DC15504.3090503@gmail.com> <BANLkTikay4xhQoZs2L0uRLSXgUMfCE9yfA@mail.gmail.com> <4DC160F0.1030201@gmail.com> <BANLkTikTYpLHM=GAeGAVfufqZ5XT0FSAzw@mail.gmail.com> <BANLkTi=kjBSuMjPcgfXTUvZ3iwmS1bN50Q@mail.gmail.com> <4DC17704.3020201@gmail.com> <BANLkTimpGpNrkE3WUdurduqrVumocDRwfQ@mail.gmail.com> <4DC1824B.6040609@gmail.com> <BANLkTi=hhsiDs=fdZRsthp_+5Hs+pR4L6A@mail.gmail.com> <4DC1956A.5020204@gmail.com> <BANLkTik8rnsKP4xq+Gj5G4dsG=UOVnkNSQ@mail.gmail.com> <4DC1A8C9.9090406@gmail.com> <BANLkTikkOS34CC+ML0JNJgHDoRqbs9rY9w@mail.gmail.com> <4DC1D165.7010705@gmail.com> <4DC1D5FC.6040608@gmail.com> <BANLkTik81Eht3NTdLXXmgqOWvjc2s_KBnw@mail.gmail.com> <BANLkTi=-heHa35w43te0ba8NufkT+MP+CQ@mail.gmail.com> <BANLkTin6ExR7+xpodbtoTAS_4WyhUXL92Q@mail.gmail.com> <BANLkTikjKib79_rLR_s2X=X-ss-+V_yw+w@mail.gmail.com> <BANLkTim4aY7oNALbOfZ2V-htivVmQJZDiA@mail.gmail.com> <BANLkTi=7MDUAfjJb697uRwrrxB-4v5fQ3A@mail.gmail.com>
In-Reply-To: <BANLkTi=7MDUAfjJb697uRwrrxB-4v5fQ3A@mail.gmail.com>
Content-Type: multipart/alternative; boundary="------------040106040909010605070807"
Subject: [vwrap] Python integer types (was: The <embed> tag... is the group still interested in LLSD or DSD?)
X-BeenThere: vwrap@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Virtual World Region Agent Protocol - IETF working group <vwrap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/vwrap>, <mailto:vwrap-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/vwrap>
List-Post: <mailto:vwrap@ietf.org>
List-Help: <mailto:vwrap-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/vwrap>, <mailto:vwrap-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 07 May 2011 15:14:11 -0000

On 05/07/2011 09:45 AM, Dahlia Trimble wrote:
> I believe python supports very large integers. Try this in your python
> interpreter:
> >>> bigint = 2**(2**16)
> >>> print bigint
In fact, python features two built-in integer types:

    * plain integers (int)
    * long integers (long)

According to the python documentation on built-in numeric types
python's int is implemented using long in C. This means it has at least
32 bits, but can be larger on certain systems. E.g. on a 64bit Linux,
it'll be 64 bits long, as I've just verified myself:

    >>> import sys
    >>> 2 ** 63 - 1 == sys.maxint

Python's long is unlimited in size (at the cost of performance).
Conveniently, python converts from int to long as needed, even if no
longs are amongst the operands:

    >>> sys.maxint
    >>> sys.maxint + 1

(The L postfix indicates a long literal.) Conversion from long to int
doesn't happen implicitly, but can be done explicitly if wanted.