Re: [Jcardcal] Integers in jCard

Bert Greevenbosch <Bert.Greevenbosch@huawei.com> Wed, 04 September 2013 02:37 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 A5FC921F9F40 for <jcardcal@ietfa.amsl.com>; Tue, 3 Sep 2013 19:37:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.833
X-Spam-Level:
X-Spam-Status: No, score=-5.833 tagged_above=-999 required=5 tests=[AWL=0.766, 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 1eYqFuigjRCI for <jcardcal@ietfa.amsl.com>; Tue, 3 Sep 2013 19:37:14 -0700 (PDT)
Received: from lhrrgout.huawei.com (lhrrgout.huawei.com [194.213.3.17]) by ietfa.amsl.com (Postfix) with ESMTP id E467321F96EF for <jcardcal@ietf.org>; Tue, 3 Sep 2013 19:37:13 -0700 (PDT)
Received: from 172.18.7.190 (EHLO lhreml203-edg.china.huawei.com) ([172.18.7.190]) by lhrrg01-dlp.huawei.com (MOS 4.3.5-GA FastPath queued) with ESMTP id AWW45582; Wed, 04 Sep 2013 02:37:12 +0000 (GMT)
Received: from LHREML403-HUB.china.huawei.com (10.201.5.217) by lhreml203-edg.huawei.com (172.18.7.221) with Microsoft SMTP Server (TLS) id 14.3.146.0; Wed, 4 Sep 2013 03:36:56 +0100
Received: from SZXEML463-HUB.china.huawei.com (10.82.67.206) by lhreml403-hub.china.huawei.com (10.201.5.217) with Microsoft SMTP Server (TLS) id 14.3.146.0; Wed, 4 Sep 2013 03:37:10 +0100
Received: from szxeml558-mbx.china.huawei.com ([169.254.7.243]) by szxeml463-hub.china.huawei.com ([10.82.67.206]) with mapi id 14.01.0323.007; Wed, 4 Sep 2013 10:37: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/tyZxmzTMmvoSVpzrpURAAF0Y0AAJA8GpAAB7euAABeZ60g
Date: Wed, 04 Sep 2013 02:37:04 +0000
Message-ID: <46A1DF3F04371240B504290A071B4DB63D86F608@szxeml558-mbx.china.huawei.com>
References: <46A1DF3F04371240B504290A071B4DB63D81DF12@szxeml558-mbx.china.huawei.com> <CAJNb_g3CayLmmvXpN7Qz=LwnwCPRdcXrs7G-m9o59PR8ChxLmQ@mail.gmail.com> <46A1DF3F04371240B504290A071B4DB63D8592BC@szxeml558-mbx.china.huawei.com> <CAJNb_g0zu1hTBG=3+rqj78oXY1M+oUVhB57vRbnPE4Duy5VWSQ@mail.gmail.com>
In-Reply-To: <CAJNb_g0zu1hTBG=3+rqj78oXY1M+oUVhB57vRbnPE4Duy5VWSQ@mail.gmail.com>
Accept-Language: en-GB, zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
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: Wed, 04 Sep 2013 02:37:23 -0000

Hi Michael, all,

OK, it may be true that checking the validity of floats/integers is an implementation issue that does not require our specification.

Then lets adopt the texts about integers and floats as proposed earlier:

Add to the end of section 3.4.9:

    Note: Neither JSON nor jCard prohibits using a combination of decimals and
    exponents to form an integer number. However, since vCard does not support
    decimals or exponents in integers, any decimals and exponents MUST be
    eliminated when converting an "integer" value type property from jCard to
    vCard.

Add to the end of section 3.4.10:

    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.

Best regards,
Bert


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

The header of each section does include a reference to the corresponding section of the vCard specification.  Is that enough?  I agree that these limitations are unlikely to be encountered in the majority of use-cases.

Mike

On Sun, Sep 1, 2013 at 10:19 PM, Bert Greevenbosch <Bert.Greevenbosch@huawei.com> wrote:
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.
_______________________________________________
jcardcal mailing list
jcardcal@ietf.org
https://www.ietf.org/mailman/listinfo/jcardcal