Re: [Json] Minus Zero

Carsten Bormann <cabo@tzi.org> Mon, 20 June 2016 19:52 UTC

Return-Path: <cabo@tzi.org>
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 7014512D77C for <json@ietfa.amsl.com>; Mon, 20 Jun 2016 12:52:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.6
X-Spam-Level:
X-Spam-Status: No, score=-2.6 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham autolearn_force=no
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 Kt4BdoKIttGg for <json@ietfa.amsl.com>; Mon, 20 Jun 2016 12:52:41 -0700 (PDT)
Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [IPv6:2001:4b98:c:538::197]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id BCB6912D778 for <json@ietf.org>; Mon, 20 Jun 2016 12:52:40 -0700 (PDT)
Received: from mfilter21-d.gandi.net (mfilter21-d.gandi.net [217.70.178.149]) by relay5-d.mail.gandi.net (Postfix) with ESMTP id 774B841C089; Mon, 20 Jun 2016 21:52:38 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mfilter21-d.gandi.net
Received: from relay5-d.mail.gandi.net ([IPv6:::ffff:217.70.183.197]) by mfilter21-d.gandi.net (mfilter21-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id ah-zvj1rrHUE; Mon, 20 Jun 2016 21:52:37 +0200 (CEST)
X-Originating-IP: 93.199.242.26
Received: from nar-3.local (p5DC7F21A.dip0.t-ipconnect.de [93.199.242.26]) (Authenticated sender: cabo@cabo.im) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 2072441C080; Mon, 20 Jun 2016 21:52:35 +0200 (CEST)
Message-ID: <57684982.2010705@tzi.org>
Date: Mon, 20 Jun 2016 21:52:34 +0200
From: Carsten Bormann <cabo@tzi.org>
User-Agent: Postbox 4.0.8 (Macintosh/20151105)
MIME-Version: 1.0
To: Anders Rundgren <anders.rundgren.net@gmail.com>
References: <2a7f88b9-f719-dfd8-08a9-1777833e53d8@gmail.com> <e94f3bd0-1635-b2e1-c5da-9ae350ae652d@gmail.com>
In-Reply-To: <e94f3bd0-1635-b2e1-c5da-9ae350ae652d@gmail.com>
X-Enigmail-Version: 1.2.3
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/yCGc4WL182dbQivk1aGBHUwOy_8>
Cc: Christian Zangl <coralllama@gmail.com>, "json@ietf.org" <json@ietf.org>
Subject: Re: [Json] Minus Zero
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.17
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: <https://mailarchive.ietf.org/arch/browse/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: Mon, 20 Jun 2016 19:52:43 -0000

> Serialization is not really a part of the JSON RFC.

Well, it defines a format that can be used to serialize the JSON data
model, but is not specific about corner cases in that data model.

> ECMAScript V6 (ES6) is is the only normative JSON serialization reference.

But that is only relevant to ES6 implementations; we don't have to care.

> [...]

(Attempts to get everybody else to follow the ES6 rules are generally
regarded as quixotic; see below for an example why.)

> Using ES6 there is no such thing as -0 or -0.0 during serialization
> since the algorithm is designed to produce the shortest correct
> representation which is a single zero digit.

I don't think anybody who cares about use of floating point numbers in
numerics would agree that this representation of -0.0 is "correct".  But
then representing all infinites (all of +Infinity, -Infinity, and NaN)
as "null" doesn't indicate that numerical usefulness was high on the
agenda of the ES6 specifiers.

Grüße, Carsten