Re: New Version Notification for draft-nottingham-structured-headers-00.txt

On 2 November 2017 at 15:18, Kazuho Oku <kazuhooku@gmail.com> wrote:

> ​[snip]​
>
>
> For floats, first let me state that I do not know if we even need to
> support it. To me it seems worth considering to drop it, as PHK
> suggested.
>
> That said, let me point out that you might not need to define the
> maximum number of digits permitted in fraction part. You are anyways
> expected to have some errors in floating point maths. The reason we
> had issues in JSON Header Field Values is because it permitted the use
> of exponents (i.e. "eNN") [3]. Without support for exponents, such
> issue would not happen in Structured Headers.
>
>
​Not all numbers with dots in them are interpreted as IEEE 754 floats; for
example Ruby's BigDecimal [1] and Rational [2] classes. If precise
fractional numbers are required for a header value, there should definitely
be strong statements about the required precision.

That's a big "if", though; all the fractional numbers I can think of can
quite easily be served by fixed-point numbers/integers, either by changing
the units (seconds to microseconds, say), or adding a semantic constraint
to the parsed value (e.g. q-value * 1000).  So I wouldn't be opposed to it
being dropped.

Cheers

[1]:
https://ruby-doc.org/stdlib-2.4.2/libdoc/bigdecimal/rdoc/BigDecimal.html
[2]: https://ruby-doc.org/core-2.4.2/Rational.html

-- 
  Matthew Kerwin
  http://matthew.kerwin.net.au/

Received on Thursday, 2 November 2017 05:58:31 UTC