Subject: [VCARDDAV] vCard: float as including pi

From: Nick Levinson <[email-masked]>
Date: Sat, 14 Nov 2009 15:27:46 -0800 (PST)

RFC draft section 4.6 specifies that the float value type is for real numbers. The examples given, including "3.14", are rational numbers. Real numbers also include irrational numbers, notably pi. Should not the definition be that the float value type is for rational numbers? If the existing definition is provided for consistency with other uses of float, given that pi and other irrational numbers hardly seem likely to have a use in the context for which vCard is designed ("information normally stored within an address book or directory application" (§1)), should vCard implementations be allowed either to not accept or not process irrational numbers or perhaps to convert them to rational approximations but with a caution to vCard authors that irrational values may be unpredictably approximated?

Thank you.

-- 
Nick

---

From: Simon Perreault <[email-masked]>
Date: Sun, 15 Nov 2009 20:50:31 -0500

On 11/14/2009 06:27 PM, Nick Levinson wrote:
>Should not the definition be that the float value type is for rational 
numbers?

Then we could say that e.g. 1/3 also cannot be expressed with a float 
value type.

> should vCard implementations be allowed either to not accept or not process irrational numbers or perhaps to convert them to rational approximations but with a caution to vCard authors that irrational values may be unpredictably approximated?

How could a vCard implementation decide that a number is irrational?

Simon
-- 
DNS64 open-source   --> http://ecdysis.viagenie.ca
STUN/TURN server    --> http://numb.viagenie.ca
vCard 4.0           --> http://www.vcarddav.org

---

From: Markus Lorenz <[email-masked]>
Date: Mon, 16 Nov 2009 13:43:05 +0100

> Then we could say that e.g. 1/3 also cannot be expressed with a float

As I understand draft 9 a float value "1/3" would not be allowed.
Section 4 defines the float value type:

   float   = [sign] 1*DIGIT ["." 1*DIGIT]

According to this definition you can not express any number which has an
infinite number of digits in the decimal number system, like 1/3 or PI
would have. But the mathematical concept of real numbers also includes
these. So the specification is wrong by saying

   The "float" value type is used to express real numbers.

because you can not express everything with the decimal number system
what the mathematical term of "real numbers" defines.

If I don't misunderstand this discussion, then the definition of the
float value type by itself bounds the possible values to rational
numbers. This is, because you can only write a finite number of digits
into a vCard.

I think the problem could be solved by changing the section 4.6 to the
following:

   "float": The "float" value type is used to express rational numbers.
   If sign is not specified, the value is assumed positive "+".
   Multiple "float" values can be specified using the comma-separated
   notation.

   Examples:

       20.30
       1000000.0000001
       1.333,3.14

I just changed the word "real" to "rational".

Markus

---

From: Simon Perreault <[email-masked]>
Date: Mon, 16 Nov 2009 07:46:52 -0500

> numbers. This is, because you can only write a finite number of digits

My point is that 1/3 is rational yet cannot be expressed as a float value.
Therefore "rational" is no better than "real".

Note: right now nothing makes use of the float value type. But maybe extensions
will in the future.

Simon

---

From: Markus Lorenz <[email-masked]>
Date: Mon, 16 Nov 2009 13:55:05 +0100

> Therefore "rational" is no better than "real".

Oh, I'm sorry. I did not understand this point.

> Note: right now nothing makes use of the float value type. But maybe extensions

Right. I thought of GEO, but as I see the value type has been changed to
URI.

Thanks