Re: [Cbor] 7049bis: Diagnostic notation gaps

Thiago Macieira <thiago.macieira@intel.com> Fri, 11 September 2020 21:47 UTC

Return-Path: <thiago.macieira@intel.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CFA323A0A4F for <cbor@ietfa.amsl.com>; Fri, 11 Sep 2020 14:47:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] 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 BgQXwRQ4E2mx for <cbor@ietfa.amsl.com>; Fri, 11 Sep 2020 14:47:17 -0700 (PDT)
Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 1C3953A095E for <cbor@ietf.org>; Fri, 11 Sep 2020 14:47:16 -0700 (PDT)
IronPort-SDR: amqUwQ9hTcTuiFnWPLMHJjP6rHW+CtvLFrBKOWDqUtYOyMIAyOZKBsjWZQusI6J2EyYK88E2uO NySfJQt7TbHA==
X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="223047524"
X-IronPort-AV: E=Sophos;i="5.76,417,1592895600"; d="scan'208";a="223047524"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 14:47:16 -0700
IronPort-SDR: VZknAAsfnJI5Ze9gKoqsf43xvacLzuR3GrqCI1p1weenwzmd1FwHl9Fn59aws/Y6dnSfNPlDRw 58Q9Qol+Sx8A==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.76,417,1592895600"; d="scan'208";a="305399626"
Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga006.jf.intel.com with ESMTP; 11 Sep 2020 14:47:16 -0700
Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Fri, 11 Sep 2020 14:47:15 -0700
Received: from orsmsx101.amr.corp.intel.com (10.22.225.128) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Fri, 11 Sep 2020 14:47:15 -0700
Received: from tjmaciei-mobl1.localnet (10.254.85.139) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 11 Sep 2020 14:47:15 -0700
From: Thiago Macieira <thiago.macieira@intel.com>
To: <cbor@ietf.org>
Date: Fri, 11 Sep 2020 14:47:14 -0700
Message-ID: <2455180.qK2NzYU5AI@tjmaciei-mobl1>
Organization: Intel Corporation
In-Reply-To: <1973898.N1gx0QA8IB@tjmaciei-mobl1>
References: <2766F4E6-0E67-472B-8BFA-75C529F4EE80@tzi.org> <1973898.N1gx0QA8IB@tjmaciei-mobl1>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Originating-IP: [10.254.85.139]
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/3x1inHfppSYl_yb1yhCKXuNhLnk>
Subject: Re: [Cbor] 7049bis: Diagnostic notation gaps
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 11 Sep 2020 21:47:19 -0000

On Friday, 11 September 2020 14:30:24 PDT Thiago Macieira wrote:
> It would be far easier to dump the binary representation of the entire
> floating point number, including the exponent bits. If this format were
> allowed, a diagnostic printer with no support for stringifying floating
> point numbers could use it for other values too.

By the way, should we explicitly allow hexadecimal floating point notation?

Appendix A has:

   | 3.4028234663852886e+38       | 0xfa7f7fffff                       |

This would also allow printing 0xf.fffffp+124 or 0x1.fffffep+127. The first 
form is what glibc's printf %a formatter prints, the second is the far easier 
one to produce without a floating-point formatter, by just decoding 0x7f7fffff 
as sign = 0, unbiased exp = 127 , significand = 0xffffff.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering