
From sonny@fastmail.net  Sun Jul  5 10:45:17 2015
Return-Path: <sonny@fastmail.net>
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 028811A8957 for <json@ietfa.amsl.com>; Sun,  5 Jul 2015 10:45:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.001
X-Spam-Level: 
X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, 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 c0CiKp0Ri4Bl for <json@ietfa.amsl.com>; Sun,  5 Jul 2015 10:45:15 -0700 (PDT)
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 766231A8900 for <json@ietf.org>; Sun,  5 Jul 2015 10:45:15 -0700 (PDT)
Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id AD29F2060B for <json@ietf.org>; Sun,  5 Jul 2015 13:45:14 -0400 (EDT)
Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Sun, 05 Jul 2015 13:45:14 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-type:date:from:message-id:mime-version:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=QdIaz47VEd0fvhm67E+2Nih7ccg =; b=GsyN4kUC7I3yFpSBqLhcMABv6azJ/ucOXupnPcQe/DS2DhTR+XDhOvA7UCW yK6WDxFr0eCpQox5QXLtLtnn9yEUJEO2XnQGlM+FPKdPaN/S27sHCT0WxGes/4oJ Zp1TrDUNQ47sdhE3XvwpfQmkbcNCQBLak45hbeg5ZJb5vJXg=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Qd Iaz47VEd0fvhm67E+2Nih7ccg=; b=g2XWUFSO2RBYTpPSB544orHzJyMkz5iyBw PTxuLp8yC+3wGZ1dzVgIv/8tWqvD2KHsdfIAhCr2cVkNGXWz7DPWM5JtdkJwm0eV nczw31kyXVLKj0YoLjkF+Z3x+pl6bGjghXDP0hvSMOfxUTm+OJ5tMtY1I26dwVQl /VRCjsHxw=
X-Sasl-enc: bVwDGdO/eaplNCt4lQtZk8Wq0M/BS6+VWlB+4scT0WYg 1436118314
Received: from sonny-laptop.local (teleyecla-101-230-100-176.cpes.teleyecla.net [176.100.230.101]) by mail.messagingengine.com (Postfix) with ESMTPA id 38BD4C0028C for <json@ietf.org>; Sun,  5 Jul 2015 13:45:14 -0400 (EDT)
Message-ID: <55996D2C.8050907@fastmail.net>
Date: Sun, 05 Jul 2015 19:45:16 +0200
From: Sonny Piers <sonny@fastmail.net>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0
MIME-Version: 1.0
To: json@ietf.org
Content-Type: multipart/alternative; boundary="------------080903020409090403000102"
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/35v08qpRbhc5nIJrsTEkA0QWzhA>
Subject: [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 17:52:21 -0000

This is a multi-part message in MIME format.
--------------080903020409090403000102
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

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.

--------------080903020409090403000102
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hello,<br>
    <br>
    Signed zeros are included in the
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    IEEE floating point standard.<br>
    From my understanding RFC 7159 doesn't forbid them.<br>
    But both python and ECMAScript serialize signed zeros (-0) into "0".<br>
    <br>
    I wonder what would be the correct way of serializing them.<br>
    <br>
    Thanks.<br>
  </body>
</html>

--------------080903020409090403000102--


From nobody Sun Jul  5 11:54:10 2015
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 BFFAF1A009F for <json@ietfa.amsl.com>; Sun,  5 Jul 2015 11:54:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level: 
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=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 BRMLA4B8IWoL for <json@ietfa.amsl.com>; Sun,  5 Jul 2015 11:54:07 -0700 (PDT)
Received: from mail-la0-x229.google.com (mail-la0-x229.google.com [IPv6:2a00:1450:4010:c03::229]) (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 67ADD1A004B for <json@ietf.org>; Sun,  5 Jul 2015 11:54:07 -0700 (PDT)
Received: by lagx9 with SMTP id x9so131543686lag.1 for <json@ietf.org>; Sun, 05 Jul 2015 11:54:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;  h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=N3VKJEkQFjY5ay887/aNs+WwJvv6G1tZdkLYASiAKQI=; b=aBJU3pXwnL4UI9OPI4cRFmh/JtW3gda12zD7CHU0bzoUOcQmv1lcboMfIwF23RbJwQ oqfKjF7eVLkX6/CTBjYIxX3s2R6+AZfq6PPeqjDTtQfbdmj7Sn0wvUhbVX2CM0M5L7Gh CmFio+bDzfuS1pzEltutiNYAYjvCbqaw8jV8G9TKj+j68CIa/5fyj1cgiStdhDY3kgnv trhJougxdJOsVdt6eot+AXB/gC2GsDkd7odZlFh/VE6KYL4HcqX3QKMa9dJEvwbCMKSx dppfVftbbKIFyfdls7xvV8dUgzPA0YjWhqqfvAEu2ARZvQmDmn2/qB8xEeSjfr9Nward WiKg==
MIME-Version: 1.0
X-Received: by 10.112.172.4 with SMTP id ay4mr6102494lbc.124.1436122445738; Sun, 05 Jul 2015 11:54:05 -0700 (PDT)
Sender: hallam@gmail.com
Received: by 10.112.203.163 with HTTP; Sun, 5 Jul 2015 11:54:05 -0700 (PDT)
In-Reply-To: <55996D2C.8050907@fastmail.net>
References: <55996D2C.8050907@fastmail.net>
Date: Sun, 5 Jul 2015 14:54:05 -0400
X-Google-Sender-Auth: WLwNHxp5oejFtB6DuRF9zmlLocg
Message-ID: <CAMm+LwizHhoYFQJyytKBSXR8Zn_nbiUQBdWxypa3C0NXtF0OUQ@mail.gmail.com>
From: Phillip Hallam-Baker <ietf@hallambaker.com>
To: Sonny Piers <sonny@fastmail.net>
Content-Type: multipart/alternative; boundary=001a11c345a83b7ac8051a255009
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/WIAkvseHLLXXRftIrg83yWJRp5s>
Cc: JSON WG <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 18:54:08 -0000

--001a11c345a83b7ac8051a255009
Content-Type: text/plain; charset=UTF-8

Same as NaN, you can't.

I propose extending JSON with a binary encoding for that exact reason and
to allow the precision of binary numbers to be preserved. But this could
also be done using Hex.

On Sun, Jul 5, 2015 at 1:45 PM, 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
>
>

--001a11c345a83b7ac8051a255009
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Same as NaN, you can&#39;t.<div><br></div><div>I propose e=
xtending JSON with a binary encoding for that exact reason and to allow the=
 precision of binary numbers to be preserved. But this could also be done u=
sing Hex.</div></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Sun, Jul 5, 2015 at 1:45 PM, Sonny Piers <span dir=3D"ltr">&lt;<a hr=
ef=3D"mailto:sonny@fastmail.net" target=3D"_blank">sonny@fastmail.net</a>&g=
t;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0=
 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 =20

   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    Hello,<br>
    <br>
    Signed zeros are included in the
   =20
    IEEE floating point standard.<br>
    From my understanding RFC 7159 doesn&#39;t forbid them.<br>
    But both python and ECMAScript serialize signed zeros (-0) into &quot;0=
&quot;.<br>
    <br>
    I wonder what would be the correct way of serializing them.<br>
    <br>
    Thanks.<br>
  </div>

<br>_______________________________________________<br>
json mailing list<br>
<a href=3D"mailto:json@ietf.org">json@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/json" rel=3D"noreferrer" t=
arget=3D"_blank">https://www.ietf.org/mailman/listinfo/json</a><br>
<br></blockquote></div><br></div>

--001a11c345a83b7ac8051a255009--


From nobody Sun Jul  5 11:57:13 2015
Return-Path: <cabo@tzi.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 93CEB1A03A3 for <json@ietfa.amsl.com>; Sun,  5 Jul 2015 11:57:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.549
X-Spam-Level: 
X-Spam-Status: No, score=-1.549 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HELO_EQ_DE=0.35, HTML_MESSAGE=0.001] autolearn=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 MRIzELCbreM5 for <json@ietfa.amsl.com>; Sun,  5 Jul 2015 11:57:11 -0700 (PDT)
Received: from mailhost.informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 967FE1A8851 for <json@ietf.org>; Sun,  5 Jul 2015 11:57:09 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from submithost.informatik.uni-bremen.de (submithost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::b]) by mailhost.informatik.uni-bremen.de (8.14.5/8.14.5) with ESMTP id t65Iv3KD022338; Sun, 5 Jul 2015 20:57:03 +0200 (CEST)
Received: from alma.local (p5DC7EA60.dip0.t-ipconnect.de [93.199.234.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by submithost.informatik.uni-bremen.de (Postfix) with ESMTPSA id 3mPfQl0Y02z3GFt; Sun,  5 Jul 2015 20:57:02 +0200 (CEST)
Date: Sun, 5 Jul 2015 20:57:01 +0200
From: Carsten Bormann <cabo@tzi.org>
To: Sonny Piers <sonny@fastmail.net>, json@ietf.org
Message-ID: <etPan.55997dfd.73864aa0.109d5@alma.local>
In-Reply-To: <55996D2C.8050907@fastmail.net>
References: <55996D2C.8050907@fastmail.net>
X-Mailer: Airmail (303)
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="55997dfd_7e82f69f_109d5"
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/irMXBK-seEDeU5iCVF2Ac-0k4TM>
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 18:57:12 -0000

--55997dfd_7e82f69f_109d5
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

http://www.ietf.org/mail-archive/web/json/current/msg01661.html

(And the whole thread around that.)

Gr=C3=BC=C3=9Fe, Carsten

On 5 Jul 2015 at 19:52:31, Sonny Piers (sonny=40fastmail.net) wrote:

Hello,

Signed zeros are included in the IEEE floating point standard.
=46rom my understanding R=46C 7159 doesn't forbid them.
But both python and ECMAScript serialize signed zeros (-0) into =220=22.

I wonder what would be the correct way of serializing them.

Thanks.
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F =20
json mailing list =20
json=40ietf.org =20
https://www.ietf.org/mailman/listinfo/json =20

--55997dfd_7e82f69f_109d5
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

<html><head><style>body=7Bfont-family:Helvetica,Arial;font-size:13px=7D</=
style></head><body style=3D=22word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;=22><div id=3D=22bloop=5Fcust=
omfont=22 style=3D=22font-family:Helvetica,Arial;font-size:13px; color: r=
gba(0,0,0,1.0); margin: 0px; line-height: auto;=22><a href=3D=22http://ww=
w.ietf.org/mail-archive/web/json/current/msg01661.html=22>http://www.ietf=
.org/mail-archive/web/json/current/msg01661.html</a></div><div id=3D=22bl=
oop=5Fcustomfont=22 style=3D=22font-family:Helvetica,Arial;font-size:13px=
; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;=22><br></div><d=
iv id=3D=22bloop=5Fcustomfont=22 style=3D=22font-family:Helvetica,Arial;f=
ont-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;=22=
>(And the whole thread around that.)</div> <br> <div id=3D=22bloop=5Fsign=
=5F1436122606967245056=22 class=3D=22bloop=5Fsign=22><div style=3D=22font=
-family:helvetica,arial;font-size:13px=22>Gr=C3=BC=C3=9Fe, Carsten</div><=
/div> <br><p class=3D=22airmail=5Fon=22 style=3D=22color:=23000;=22>On 5 =
Jul 2015 at 19:52:31, Sonny Piers (<a href=3D=22mailto:sonny=40fastmail.n=
et=22>sonny=40fastmail.net</a>) wrote:</p> <blockquote type=3D=22cite=22 =
class=3D=22clean=5Fbq=22><span><div bgcolor=3D=22=23=46=46=46=46=46=46=22=
 text=3D=22=23000000=22><div></div><div>





<title></title>


Hello,<br>
<br>
Signed zeros are included in the IEEE floating point
standard.<br>
=46rom my understanding R=46C 7159 doesn't forbid them.<br>
But both python and ECMAScript serialize signed zeros (-0) into
=220=22.<br>
<br>
I wonder what would be the correct way of serializing them.<br>
<br>
Thanks.<br>


=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F
<br>json mailing list
<br>json=40ietf.org
<br>https://www.ietf.org/mailman/listinfo/json
<br></div></div></span></blockquote></body></html>
--55997dfd_7e82f69f_109d5--


From nobody Sun Jul  5 12:52:01 2015
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, 5 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

--001a113818943ef6e6051a261f52
Content-Type: text/plain; charset=UTF-8

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
>
>

--001a113818943ef6e6051a261f52
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p dir=3D"ltr">I think the best practical advice is: Do whatever will produ=
ce the least surprise after round-tripping through JavaScript.</p>
<div class=3D"gmail_quote">On Jul 5, 2015 10:52 AM, &quot;Sonny Piers&quot;=
 &lt;<a href=3D"mailto:sonny@fastmail.net">sonny@fastmail.net</a>&gt; wrote=
:<br type=3D"attribution"><blockquote class=3D"gmail_quote" style=3D"margin=
:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
 =20

   =20
 =20
  <div bgcolor=3D"#FFFFFF" text=3D"#000000">
    Hello,<br>
    <br>
    Signed zeros are included in the
   =20
    IEEE floating point standard.<br>
    From my understanding RFC 7159 doesn&#39;t forbid them.<br>
    But both python and ECMAScript serialize signed zeros (-0) into &quot;0=
&quot;.<br>
    <br>
    I wonder what would be the correct way of serializing them.<br>
    <br>
    Thanks.<br>
  </div>

<br>_______________________________________________<br>
json mailing list<br>
<a href=3D"mailto:json@ietf.org">json@ietf.org</a><br>
<a href=3D"https://www.ietf.org/mailman/listinfo/json" rel=3D"noreferrer" t=
arget=3D"_blank">https://www.ietf.org/mailman/listinfo/json</a><br>
<br></blockquote></div>

--001a113818943ef6e6051a261f52--


From nobody Sun Jul  5 13:08:50 2015
Return-Path: <cabo@tzi.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 316071A8A50 for <json@ietfa.amsl.com>; Sun,  5 Jul 2015 13:08:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.349
X-Spam-Level: 
X-Spam-Status: No, score=0.349 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, HELO_EQ_DE=0.35] autolearn=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 C3_QdL9iiuIw for <json@ietfa.amsl.com>; Sun,  5 Jul 2015 13:08:48 -0700 (PDT)
Received: from mailhost.informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 160111A8A83 for <json@ietf.org>; Sun,  5 Jul 2015 13:08:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from submithost.informatik.uni-bremen.de (submithost.informatik.uni-bremen.de [134.102.201.11]) by mailhost.informatik.uni-bremen.de (8.14.5/8.14.5) with ESMTP id t65K8dxX008839; Sun, 5 Jul 2015 22:08:39 +0200 (CEST)
Received: from alma.local (ip-109-47-3-74.web.vodafone.de [109.47.3.74]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by submithost.informatik.uni-bremen.de (Postfix) with ESMTPSA id 3mPh1K6SmJz3Gt4; Sun,  5 Jul 2015 22:08:37 +0200 (CEST)
Message-ID: <55998EC1.3010309@tzi.org>
Date: Sun, 05 Jul 2015 22:08:33 +0200
From: Carsten Bormann <cabo@tzi.org>
User-Agent: Postbox 4.0.1 (Macintosh/20150514)
MIME-Version: 1.0
To: Sonny Piers <sonny@fastmail.net>, JSON WG <json@ietf.org>
References: <55996D2C.8050907@fastmail.net> <CAMm+LwizHhoYFQJyytKBSXR8Zn_nbiUQBdWxypa3C0NXtF0OUQ@mail.gmail.com>
In-Reply-To: <CAMm+LwizHhoYFQJyytKBSXR8Zn_nbiUQBdWxypa3C0NXtF0OUQ@mail.gmail.com>
X-Enigmail-Version: 1.2.3
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Archived-At: <http://mailarchive.ietf.org/arch/msg/json/RRT0jWUruScN1oXlgZlTqETivSU>
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 20:08:49 -0000

Phillip Hallam-Baker wrote:
> Same as NaN, you can't.

Not the same.

There is no representation for NaN in JSON.
(The usual recommendation is to substitute `null`.)
The reason is as arcane as it is frustrating:
JavaScript handles NaN etc. using variables, so there is no syntax in
the JavaScript value notation that became JSON.

There are a number of representations for negative zeros.

JavaScript can even properly parse and decode them, e.g.:

JSON.parse("-0")
-0

It just can't roundtrip them:

JSON.stringify(-0)
"0"

So if it is indeed important for you to be able to roundtrip negative
zeros through JavaScript, you'll need to invent something.
Such as representing negative zero by a string, "-0".
(JavaScript can roundtrip those, but of course you are on your own in
decoding them.)

Grüße, Carsten

