Subject: Re: [Cellar] patch on textual expressions of floats in EBML Schema

From: Steve Lhomme <[email-masked]>
Date: Sun, 8 May 2016 13:42:34 +0200

2016-04-18 18:00 GMT+02:00 Dave Rice <[email-masked]>:
>
>> On Apr 18, 2016, at 11:57 AM, Moritz Bunkus <[email-masked]> wrote:
>>
>> Hey,
>>
>>>> I think the parser can resolve this issue without much trouble. In this
>>> context, the hyphen expresses a negative binary power, when it is preceded
>>> by a 'P' or 'p'. On the other hand, the hyphen serves as the delimiter
>>> between the minimum and maximum values, when it is not preceded by a 'P' or
>>> 'p'. This criterion can be used to distinguish the two cases.
>>
>> I agree. If a p occurs the following element must be the
>> exponent. Therefore there's no ambiguity.
>
> Regarding such interpretation, currently specdata.xml expresses float range in a style of "0.0-1.0". Should we say that both forms are valid as ranges? Or that "0x0p+1-0x1p+0" is valid but "0.0-1.0" is invalid.

For the moment the range value is not used to generate code. Only
"0-1" integers are assumed to be boolean. So these changes won't
affect the generated code.

>>> In this context, does 'float' mean only 32-bit floats, or does it mean
>>> both 32-bit floats and 64-bit doubles? If it is the latter, then I think
>>> 'floating constant' (given in the C11 standard) may be a more unambiguous
>>> term.
>>
>> The specs always talk about the numerical types as they apply to EBML
>> (section "EBML Element Types" at [1]). We don't talk about data types in
>> a specific programming language; that's an implementation detail the
>> specs shouldn't care about. So "float" means up to 64bits, just as
>> "unsigned integer" does. We don't say "uint64_t" there either.
>>
>> Kind regards,
>> mosu
>>
>> [1]  https://github.com/Matroska-Org/ebml-specification/blob/master/specification.markdown
>> _______________________________________________
>> Cellar mailing list
>> [email-masked]
>> https://www.ietf.org/mailman/listinfo/cellar
>
>
> _______________________________________________
> Cellar mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cellar
>

-- 
Steve Lhomme
Matroska association Chairman

---

From: Dave Rice <[email-masked]>
Date: Mon, 9 May 2016 23:49:29 -0400

> On May 8, 2016, at 7:42 AM, Steve Lhomme <[email-masked]> wrote:
> 

In that case I supplied a pull request here which changes &gt; 0” to "&gt;0x0p+1"
https://github.com/Matroska-Org/foundation-source/pull/16/files.

Also note that the definition of SamplingFrequency (a float element) includes a default of “8000.0”. My Hexadecimal Floating-Point Constants skills are still new; Nithin, what is the Hexadecimal Floating-Point Constants form of 8000?

---

From: Nithin Mathew Kurien <[email-masked]>
Date: Tue, 10 May 2016 14:27:15 +0530

Hi,

On Tue, May 10, 2016 at 9:19 AM, Dave Rice <[email-masked]> wrote:

> >> Regarding such interpretation, currently specdata.xml expresses float
> range in a style of "0.0-1.0". Should we say that both forms are valid as
> ranges? Or that "0x0p+1-0x1p+0" is valid but "0.0-1.0" is invalid.
> >
> Also note that the definition of SamplingFrequency (a float element)
> includes a default of “8000.0”. My Hexadecimal Floating-Point Constants
> skills are still new; Nithin, what is the Hexadecimal Floating-Point
> Constants form of 8000?
>

It is 0x1.f4p+12. Also, there is a small typo in
https://github.com/Matroska-Org/ebml-specification/pull/61.

+Within an expression of a float range, as in an integer range, the `-`
(hyphen) character is the separator between the minimal and maximum value
permitted by the range. Note that Hexadecimal Floating-Point Constants also
use a `-` (hyphen) when indicating a negative binary power. Within a float
range, when a `-` (hyphen) is immediately preceded by a letter `p`, then
the `-` (hyphen) is a part of the Hexadecimal Floating-Point Constant which
notes negative binary power. Within a float range, when a `-` (hyphen) is
immediately preceded by a letter `p`, then the `-` (hyphen) represents the
separator between the minimal and maximum value permitted by the range.

The last sentence should be "Within a float range, when a `-` (hyphen) is
*not* immediately preceded by a letter `p`, then the `-` (hyphen)
represents the separator between the minimal and maximum value permitted by
the range."

Thanks and regards,
Nithin

---

From: Steve Lhomme <[email-masked]>
Date: Wed, 18 May 2016 08:23:27 +0200

> https://github.com/Matroska-Org/foundation-source/pull/16/files.

I think 0x0p0 or 0x0p+0 is a clearer representation of 0.0.

---

From: Dave Rice <[email-masked]>
Date: Wed, 18 May 2016 22:34:41 -0400

> On May 18, 2016, at 2:23 AM, Steve Lhomme <[email-masked]> wrote:
> 

I updated the PR based on this comment, rebased, and pushed.

>> Also note that the definition of SamplingFrequency (a float element) includes a default of “8000.0”. My Hexadecimal Floating-Point Constants skills are still new; Nithin, what is the Hexadecimal F…

ping. What is 8000.0 as a Hexadecimal Floating-Point Constant?

---

From: Nithin Mathew Kurien <[email-masked]>
Date: Thu, 19 May 2016 13:57:19 +0530

Hi,

> ping. What is 8000.0 as a Hexadecimal Floating-Point Constant?

8000.0 = 0x1.f4p+12. Also, I've created a pull request
https://github.com/Matroska-Org/ebml-specification/pull/63 regarding a typo
in the following sentence in section "Textual expression of Floats" in
file specification.markdown; please review if necessary.

"Within a float range, when a `-` (hyphen) is immediately preceded by a
letter `p`, then the `-` (hyphen) represents the separator between the
minimal and maximum value permitted by the range."

This sentence should have been "Within a float range, when a `-` (hyphen)
is not immediately preceded by a letter `p`, then the `-` (hyphen)
represents the separator between the minimal and maximum value permitted by
the range."

Thanks and regards,
Nithin