Re: [Json] I-JSON Topic #5: Numbers

John Cowan <cowan@mercury.ccil.org> Tue, 27 May 2014 19:26 UTC

Return-Path: <cowan@ccil.org>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 57E1A1A0221 for <json@ietfa.amsl.com>; Tue, 27 May 2014 12:26:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.251
X-Spam-Level:
X-Spam-Status: No, score=-3.251 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RP_MATCHES_RCVD=-0.651] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QUDKrK0OwzQX for <json@ietfa.amsl.com>; Tue, 27 May 2014 12:26:34 -0700 (PDT)
Received: from earth.ccil.org (earth.ccil.org [192.190.237.11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9AD391A020A for <json@ietf.org>; Tue, 27 May 2014 12:26:34 -0700 (PDT)
Received: from cowan by earth.ccil.org with local (Exim 4.72) (envelope-from <cowan@ccil.org>) id 1WpN0z-0006ZQ-Iz; Tue, 27 May 2014 15:26:25 -0400
Date: Tue, 27 May 2014 15:26:25 -0400
From: John Cowan <cowan@mercury.ccil.org>
To: Carsten Bormann <cabo@tzi.org>
Message-ID: <20140527192625.GC16220@mercury.ccil.org>
References: <CFA21B5C.4A721%jhildebr@cisco.com> <255B9BB34FB7D647A506DC292726F6E1154629E87D@WSMSG3153V.srv.dir.telstra.com> <CAHBU6isO7oooeN8rH8emx-xuOrs2yzBUrhyJNYYAyzK2-QfF0w@mail.gmail.com> <CAK3OfOih-YO-ncbSc3dVv_O7uHfjRxCDjUpzHmkFG5Dj7kb-xg@mail.gmail.com> <5384C118.4060402@cisco.com> <14DB352D-3D0C-458A-90BE-38BCA8CC98DD@tzi.org> <CAHBU6isjZjfoga_g9efiK1L=Pf40ZQXg8War+k9JDM13quHPOQ@mail.gmail.com> <DF223160-A135-4B8E-A895-53A4BF63AA1E@tzi.org> <5384D0C2.7030407@cisco.com> <62E6DC51-2D3D-4C55-89D8-19810347A9FB@tzi.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <62E6DC51-2D3D-4C55-89D8-19810347A9FB@tzi.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Sender: John Cowan <cowan@ccil.org>
Archived-At: http://mailarchive.ietf.org/arch/msg/json/-oXWpWAQanYfVTJk4Ion_w_P4Pw
Cc: Nico Williams <nico@cryptonector.com>, IETF JSON WG <json@ietf.org>, Tim Bray <tbray@textuality.com>, Matt Miller <mamille2@cisco.com>
Subject: Re: [Json] I-JSON Topic #5: Numbers
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 27 May 2014 19:26:36 -0000

Carsten Bormann scripsit:

>    Software which implements IEEE 754-2008 binary64 (double precision)
>    numbers [IEEE754] is generally available and widely used.
>    Implementations which generate I-JSON messages MUST NOT assume that
>    receiving implementations can process numeric values with greater
>    magnitude or precision than provided by those numbers.  I-JSON
>    messages SHOULD NOT include numbers which express greater magnitude
>    or precision than an IEEE 754 double precision number provides,
>    for example 1E400 or 3.141592653589793238462643383279.  In
>    particular, an I-JSON sender MUST NOT expect a receiver to treat
>    an integer whose absolute value is greater than 9007199254740992
>    (i.e., that is outside the range [-2**53, 2**53], where ** stands
>    for exponentiation) as an exact value.
> 
> This then leads well into the next paragraph:
> 
>    For applications such as cryptography, where exact interchange
>    of much larger numbers is reasonably required, it is RECOMMENDED to
>    encode them in JSON string values.  This requires that the receiving
>    program understand the intended semantic of the value.

+1

-- 
John Cowan          http://www.ccil.org/~cowan        cowan@ccil.org
So they play that [tune] on their fascist banjos, eh?
        --Great-Souled Sam