Re: [Json] on serialization of signed zero

Tim Bray <tbray@textuality.com> Sun, 05 July 2015 19:52 UTC

Return-Path: <tbray@textuality.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 D2E491A892E for <json@ietfa.amsl.com>; Sun, 5 Jul 2015 12:52:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.977
X-Spam-Level:
X-Spam-Status: No, score=-1.977 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 FCrvN-EmorGb for <json@ietfa.amsl.com>; Sun, 5 Jul 2015 12:51:59 -0700 (PDT)
Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6CDFD1A891D for <json@ietf.org>; Sun, 5 Jul 2015 12:51:59 -0700 (PDT)
Received: by pabvl15 with SMTP id vl15so83743327pab.1 for <json@ietf.org>; Sun, 05 Jul 2015 12:51:58 -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=VkcVITCLNyLhBOVahclICLNqfYbe/gdviQRt07I5Q2k=; b=FOSA5JRrchPOcjgmPADdpaoKefr82cSYzw2HJcTx91YEyyJsxtRlceQD7txnqdJHfi uNZai8t5smum0P4fc4UYcCR+RPnRhl550Ae/AZanejgw/rOg/lfF6Zjl8/MXFafVTyRw apSfTZN5Nx5ZToXj3WpOcvhha51WgTOUh2L1ODVMtaoRite1N3hEmpKnVjj+YI+Xws/a cnyjnCfF8uDqettofFc7945y/omZ0PO5SQdyWfMi01WiPxfA19ONXhLpkiRY1kYFbl6V Bg35FS/3LqY0PJWv2DWc2uf4jWb3k8LXRz91eRsMg/Ip9BquVH0T828mUAcTz/qjbFtN BjzA==
X-Gm-Message-State: ALoCoQlxLgbbx1Lgs4IQEfgf9yAUXuMnMSG3YTPa3rz7KFM1NNBCYL+GDtpb/v5fDruPwODMf/2F
MIME-Version: 1.0
X-Received: by 10.68.69.46 with SMTP id b14mr61201238pbu.81.1436125918843; Sun, 05 Jul 2015 12:51:58 -0700 (PDT)
Received: by 10.66.149.130 with HTTP; Sun, 5 Jul 2015 12:51:58 -0700 (PDT)
X-Originating-IP: [209.52.88.217]
Received: by 10.66.149.130 with HTTP; Sun, 5 Jul 2015 12:51:58 -0700 (PDT)
In-Reply-To: <55996D2C.8050907@fastmail.net>
References: <55996D2C.8050907@fastmail.net>
Date: Sun, 05 Jul 2015 12:51:58 -0700
Message-ID: <CAHBU6itdGYyL55Ffvbc4SUH5E0Fkj5Y8C_W8zVpOFdqAh_jDMA@mail.gmail.com>
From: Tim Bray <tbray@textuality.com>
To: Sonny Piers <sonny@fastmail.net>
Content-Type: multipart/alternative; boundary="001a113818943ef6e6051a261f52"
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/UuahtMf-bPeuwjowhfPvt9nBWL4>
Cc: json@ietf.org
Subject: Re: [Json] on serialization of signed zero
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: <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: Sun, 05 Jul 2015 19:52:01 -0000

I think the best practical advice is: Do whatever will produce the least
surprise after round-tripping through JavaScript.
On Jul 5, 2015 10:52 AM, "Sonny Piers" <sonny@fastmail.net> wrote:

>  Hello,
>
> Signed zeros are included in the IEEE floating point standard.
> From my understanding RFC 7159 doesn't forbid them.
> But both python and ECMAScript serialize signed zeros (-0) into "0".
>
> I wonder what would be the correct way of serializing them.
>
> Thanks.
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>
>