Re: [Jcardcal] Integers in jCard

Bert Greevenbosch <Bert.Greevenbosch@huawei.com> Mon, 02 September 2013 02:19 UTC

Return-Path: <Bert.Greevenbosch@huawei.com>
X-Original-To: jcardcal@ietfa.amsl.com
Delivered-To: jcardcal@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 21C2D11E82D1 for <jcardcal@ietfa.amsl.com>; Sun, 1 Sep 2013 19:19:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.788
X-Spam-Level:
X-Spam-Status: No, score=-5.788 tagged_above=-999 required=5 tests=[AWL=0.811, BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tPeA31JrSiAk for <jcardcal@ietfa.amsl.com>; Sun, 1 Sep 2013 19:19:15 -0700 (PDT)
Received: from lhrrgout.huawei.com (lhrrgout.huawei.com [194.213.3.17]) by ietfa.amsl.com (Postfix) with ESMTP id 3F59411E81B0 for <jcardcal@ietf.org>; Sun, 1 Sep 2013 19:19:15 -0700 (PDT)
Received: from 172.18.7.190 (EHLO lhreml203-edg.china.huawei.com) ([172.18.7.190]) by lhrrg02-dlp.huawei.com (MOS 4.3.5-GA FastPath queued) with ESMTP id AUY43206; Mon, 02 Sep 2013 02:19:13 +0000 (GMT)
Received: from LHREML402-HUB.china.huawei.com (10.201.5.241) by lhreml203-edg.huawei.com (172.18.7.221) with Microsoft SMTP Server (TLS) id 14.3.146.0; Mon, 2 Sep 2013 03:19:03 +0100
Received: from SZXEML416-HUB.china.huawei.com (10.82.67.155) by lhreml402-hub.china.huawei.com (10.201.5.241) with Microsoft SMTP Server (TLS) id 14.3.146.0; Mon, 2 Sep 2013 03:19:11 +0100
Received: from szxeml558-mbx.china.huawei.com ([169.254.7.243]) by szxeml416-hub.china.huawei.com ([10.82.67.155]) with mapi id 14.01.0323.007; Mon, 2 Sep 2013 10:19:05 +0800
From: Bert Greevenbosch <Bert.Greevenbosch@huawei.com>
To: Michael Angstadt <mike.angstadt@gmail.com>
Thread-Topic: [Jcardcal] Integers in jCard
Thread-Index: Ac6lJlxl8/tyZxmzTMmvoSVpzrpURAAF0Y0AAJA8GpA=
Date: Mon, 02 Sep 2013 02:19:04 +0000
Message-ID: <46A1DF3F04371240B504290A071B4DB63D8592BC@szxeml558-mbx.china.huawei.com>
References: <46A1DF3F04371240B504290A071B4DB63D81DF12@szxeml558-mbx.china.huawei.com> <CAJNb_g3CayLmmvXpN7Qz=LwnwCPRdcXrs7G-m9o59PR8ChxLmQ@mail.gmail.com>
In-Reply-To: <CAJNb_g3CayLmmvXpN7Qz=LwnwCPRdcXrs7G-m9o59PR8ChxLmQ@mail.gmail.com>
Accept-Language: en-GB, zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-cr-hashedpuzzle: Bpqm DeeP EZ42 GjLz H3dv I8AF Ko/9 RuBf T+DH UZMp Vxd1 Xv4i aZ8e eSuO gLDR h555; 4; YgBhAHIAcgB5AGwAZQBpAGIAYQBAAGMAbwBtAHAAdQB0AGUAcgAuAG8AcgBnADsAagBjAGEAcgBkAGMAYQBsAEAAaQBlAHQAZgAuAG8AcgBnADsAawBlAHcAaQBzAGMAaABAAGcAbQBhAGkAbAAuAGMAbwBtADsAbQBpAGsAZQAuAGEAbgBnAHMAdABhAGQAdABAAGcAbQBhAGkAbAAuAGMAbwBtAA==; Sosha1_v1; 7; {EAE88C2A-C8EF-49D0-9B2C-4D0319022C3C}; YgBlAHIAdAAuAGcAcgBlAGUAdgBlAG4AYgBvAHMAYwBoAEAAaAB1AGEAdwBlAGkALgBjAG8AbQA=; Mon, 02 Sep 2013 02:18:55 GMT; UgBFADoAIABbAEoAYwBhAHIAZABjAGEAbABdACAASQBuAHQAZQBnAGUAcgBzACAAaQBuACAAagBDAGEAcgBkAA==
x-cr-puzzleid: {EAE88C2A-C8EF-49D0-9B2C-4D0319022C3C}
x-originating-ip: [10.66.162.63]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Cc: Barry Leiba <barryleiba@computer.org>, Philipp Kewisch <kewisch@gmail.com>, "jcardcal@ietf.org" <jcardcal@ietf.org>
Subject: Re: [Jcardcal] Integers in jCard
X-BeenThere: jcardcal@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: JSON data formats for vCard and iCalendar WG <jcardcal.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jcardcal>, <mailto:jcardcal-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/jcardcal>
List-Post: <mailto:jcardcal@ietf.org>
List-Help: <mailto:jcardcal-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jcardcal>, <mailto:jcardcal-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Sep 2013 02:19:21 -0000

Hi all,

@Michael: thanks for pointing out the issue with floats. Indeed floats may require conversion too.

There may be some problems with the conversion though. For example, it seems hard to convert a floating point number 3.456*10^-127 to a form without exponential. It is quite interesting to note that the vCard specification RFC 6350 forbids usage of exponentials (scientific notation), but at the same time requires similar precision as binary64.

This does not hold for huge integers, such as 2.84*10^127, as RFC 6350 gives explicit boundaries for integers (9223372036854775807 to -9223372036854775808) and the converter can break off and output an error in case these boundaries are not obeyed. With integers an issue could be a "false integer", which is actually a non-integer number with "integer" value type.

So I guess the jCard to vCard converter needs to make some decisions on which values are acceptable, and for which values it should abort the conversion and generate an error. It may need to round values to a certain precision, in which case there would be some semantic loss. I have the suspicion that this is more a theoretical problem than a practical problem, as in practice arbitrary precision or number height may not be required. However, something could have gone wrong (whether or not on purpose), and implementations should be ready for this.

Before I propose some extra text on this, I would like to gather related opinions?

Thanks and best regards,
Bert


---
From: Michael Angstadt [mailto:mike.angstadt@gmail.com] 
Sent: 2013年8月30日 20:59
To: Bert Greevenbosch
Cc: jcardcal@ietf.org; Barry Leiba; Philipp Kewisch
Subject: Re: [Jcardcal] Integers in jCard


On Thu, Aug 29, 2013 at 10:12 PM, Bert Greevenbosch <Bert.Greevenbosch@huawei.com> wrote:
To me, it seems impractical to forbid using decimals and exponents for jCard integers. A general JSON parser (which is oblivious of jCard) would ignore any such requirement anyway.

Agreed.  A similar statement should be added to the "float" section (3.4.10) about permitting exponents to be used.

BEGIN
  Note: Neither JSON nor jCard prohibits using exponents to form
  a float number. However, since vCard does not support
  exponents in floats, any exponents MUST be eliminated when
  converting a "float" value type property from jCard to vCard.
END;

Perhaps these changes should be applied to the jCal draft as well, since jCal also defines "integer" and "float" data types.