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

Phillip Hallam-Baker <hallam@gmail.com> Thu, 01 May 2014 18:40 UTC

Return-Path: <hallam@gmail.com>
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 67B691A0919 for <json@ietfa.amsl.com>; Thu, 1 May 2014 11:40:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, SPF_PASS=-0.001] 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 tWwqFiKx7nKn for <json@ietfa.amsl.com>; Thu, 1 May 2014 11:40:48 -0700 (PDT)
Received: from mail-la0-x22d.google.com (mail-la0-x22d.google.com [IPv6:2a00:1450:4010:c03::22d]) by ietfa.amsl.com (Postfix) with ESMTP id 6FCE11A073F for <json@ietf.org>; Thu, 1 May 2014 11:40:48 -0700 (PDT)
Received: by mail-la0-f45.google.com with SMTP id pv20so2441228lab.32 for <json@ietf.org>; Thu, 01 May 2014 11:40:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Alkq4NUUMgjbOrYczLHeSfX/5RZSSPhLczoF1TdGgHo=; b=0WIzPnQEYwdcAmyUMmJcpecNNN/W06Te6MUXQ/mPPbNVJBmL9tfIWjdUh9d8OYjUnx XhtE7X/cK9XBbosRNaYnG/dPZActXuXj87elr+gLhjaGfaP7iwCqvwP2wT+/w1/eiTfd ip3iVsLCthPMiH/W8GBuoW7htbiMS0EPOBQuZvF6FhRchFtpyFlmiR1m4lp9zLTT2aU8 0eO8UzIg+/lxsihr0eC+yhnZNsIuf2pgIU6tlp4WpWH/HN7eTjOCKN/6TbCfwsUwZsjl 3yaRPHgMxDeu5OHUk9Bh3HHuDWgZnl8FtEOpaQwmv5g8aVLaInQnT5VPns9AE9wAuBwr MtHA==
MIME-Version: 1.0
X-Received: by 10.152.5.202 with SMTP id u10mr2166725lau.42.1398969645522; Thu, 01 May 2014 11:40:45 -0700 (PDT)
Received: by 10.112.234.229 with HTTP; Thu, 1 May 2014 11:40:45 -0700 (PDT)
In-Reply-To: <CAHBU6itK5HtSTPWSsHsHUPja90emqU86LsgjrBorkqcUDivS2A@mail.gmail.com>
References: <535EB3BF.8080606@cisco.com> <CAHBU6ivjF9ULW0yGSVdJi2D6QgUThuhym_ZhpgLM=cvLu=mAiQ@mail.gmail.com> <CF841AAE.47D86%jhildebr@cisco.com> <CAHBU6itK5HtSTPWSsHsHUPja90emqU86LsgjrBorkqcUDivS2A@mail.gmail.com>
Date: Thu, 1 May 2014 14:40:45 -0400
Message-ID: <CAMm+Lwh1cPrtrh_4yS_UnE0KCCZ_0gDWogUt91rN26dAbhK3zA@mail.gmail.com>
From: Phillip Hallam-Baker <hallam@gmail.com>
To: Tim Bray <tbray@textuality.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Archived-At: http://mailarchive.ietf.org/arch/msg/json/xlo5XYV0noMcvZ6Zo0eSe4ooqa4
Cc: "Matt Miller \(mamille2\)" <mamille2@cisco.com>, "Joe Hildebrand \(jhildebr\)" <jhildebr@cisco.com>, IETF JSON WG <json@ietf.org>
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: Thu, 01 May 2014 18:40:50 -0000

On Mon, Apr 28, 2014 at 5:11 PM, Tim Bray <tbray@textuality.com> wrote:
> Well, they’re disallowed in JSON let alone i-json so I’d have hoped we can
> ignore them.

Actually, they are not. Since null is a valid value.

If you are writing in C or C# and parsing JSON rather than using spray
and pray scripting approaches, using null to represent NaN makes
perfect sense.

I don't think it really matters though since I haven't ever written a
network application that used floating point values as protocol data.


What I have done is to use decimal fractions 0.2222 etc. But even
then, precision has not been a major concern.

Right now I map those values to 64 bit integers with a 2^32 offset. It
works well enough.


It would be a good idea to have a JSON style format for encoding
scientific data. But JSON isn't that format right now.


-- 
Website: http://hallambaker.com/