Re: [Json] WGLC comment about numeric values

Tim Bray <tbray@textuality.com> Fri, 11 October 2013 21:08 UTC

Return-Path: <tbray@textuality.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8FF4C21E8098 for <json@ietfa.amsl.com>; Fri, 11 Oct 2013 14:08:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.053
X-Spam-Level:
X-Spam-Status: No, score=-3.053 tagged_above=-999 required=5 tests=[AWL=-0.077, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4AesLKA+E9Ed for <json@ietfa.amsl.com>; Fri, 11 Oct 2013 14:08:36 -0700 (PDT)
Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by ietfa.amsl.com (Postfix) with ESMTP id D1E5F11E80EC for <json@ietf.org>; Fri, 11 Oct 2013 14:08:34 -0700 (PDT)
Received: by mail-vc0-f170.google.com with SMTP id lc6so3251355vcb.15 for <json@ietf.org>; Fri, 11 Oct 2013 14:08:34 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=FsRsjtikK2pWoeRXMgoSgtyP98/kNOUAWlIROGNvUjc=; b=OPxPbbeJM5iaQfVN9QHiitgj/zHALzBczF2XlyurtqNl2DWF9A2Rar9Lx3PKoYDTdU RAkB8UacPDfdHvJrqiL4ysASJizZdrPVJ0NbIXgGxubQEpu9FpvFJwnutqfjm8Wr2tW/ OTAzRb/KaYq7x9VJ6KifP2QE4zYkkGlpVk/nZAqqEa7V5A4I1lQX3Xz0N0q6MBTScQ9V n0QCaPxHdFNylBqC+SQ6joanyT11HwcRbY3OS2Y0IKUZ7J1erTSm96fGduCxLZm5AIDU iKOM1lVwR3Dptz7shBIijYd+ed1P12n45vcGTC6LAjeJx7n0jI1LqTdbHUdspCgIaHIi xR8Q==
X-Gm-Message-State: ALoCoQnZeKrYvWfQQy5SyCsuEA1SHp4QN6d8sJCfff4rs6J4O+VqmdvRB7pkOEfGPAO34ySC9sCC
MIME-Version: 1.0
X-Received: by 10.52.166.200 with SMTP id zi8mr2311861vdb.38.1381525714317; Fri, 11 Oct 2013 14:08:34 -0700 (PDT)
Received: by 10.220.174.197 with HTTP; Fri, 11 Oct 2013 14:08:34 -0700 (PDT)
X-Originating-IP: [96.49.81.176]
In-Reply-To: <CAHBU6isQgyO-qai2w61T-XJoLua+u9QAneXm=doweYSRvrVz-w@mail.gmail.com>
References: <CAK3OfOhUtrd91SiLrnG=5xoNnvPGfgi4EPLwzU=jV=9oHHS4_g@mail.gmail.com> <CAHBU6isQgyO-qai2w61T-XJoLua+u9QAneXm=doweYSRvrVz-w@mail.gmail.com>
Date: Fri, 11 Oct 2013 14:08:34 -0700
Message-ID: <CAHBU6itryT-CLEVarK4TEmUJ-grkPAQ8cgx3LZcm0Axe6wyT9w@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
To: Nico Williams <nico@cryptonector.com>
Content-Type: multipart/alternative; boundary=089e01634aa6734a7504e87d8514
Cc: "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] WGLC comment about numeric values
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
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: Fri, 11 Oct 2013 21:08:41 -0000

How’s this?
==============

This specification allows implementations to set limits on the range and
precision of numbers accepted. Since software which implements IEEE
754-2008 binary64 (double precision) numbers [IEEE754] <#IEEE754> is
generally available and widely used, good interoperability can be achieved
by implementations which expect no more precision or range than these
provide, in the sense that implementations will approximate JSON numbers
within the expected precision. A JSON number which is outside those bounds,
such as 1E400 or 3.141592653589793238462643383279, may indicate potential
interoperability problems since it suggests that the software which created
it it expected greater magnitude or precision than is widely available.

Note that when such software is used, numbers which are integers and are in
the range [-(2**53)+1, (2**53)-1] are interoperable in the sense that
implementations will agree exactly on their numeric values.
==============


On Fri, Oct 11, 2013 at 1:51 PM, Tim Bray <tbray@textuality.com> wrote:

> Actually, I think the language should be adjusted to say, rather than
> generally “supports IEEE754”, more specifically “supports IEEE765 64-bit
> binary (double precision) numbers.  Then the rest falls into place.
>
>
> On Fri, Oct 11, 2013 at 12:35 PM, Nico Williams <nico@cryptonector.com>wrote;wrote:
>
>>    Note that when such software is used, numbers which are integers and
>>    are in the range [-(2**53)+1, (2**53)-1] are interoperable in the
>>    sense that implementations will agree exactly on their numeric
>>    values.
>>
>> s/implementations will/implementations most likely will/
>>
>> (Because there are implementations that only support 32-bit integers.)
>> _______________________________________________
>> json mailing list
>> json@ietf.org
>> https://www.ietf.org/mailman/listinfo/json
>>
>
>