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

On 3 November 2017 at 08:48, Willy Tarreau <w@1wt.eu> wrote:

> On Fri, Nov 03, 2017 at 09:30:08AM +1100, Mark Nottingham wrote:
> > On 2 Nov 2017, at 4:54 pm, Willy Tarreau <w@1wt.eu> wrote:
> > >
> > >> 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.
> > >
> > > +1. We can define that "q=" is specified in thousands for example and
> > > that only 3 decimals have to be parsed there.
> >
> > I'm not so sure we can do that; it's not just QValues. E.g.,
> >
> > http://httpwg.org/http-extensions/client-hints.html#dpr
>
> Interesting one. With the proposed format there's no way to reproduce
> the exact value (eg: 4000x3000 will send 1.3333 but after how many '3'
> is it enough ?). Ratios could be useful there (eg: 4000/3000) but some
> implementations will always suffer from div by zero or the funnier div
> by -1 which nobody cares to check against and which produces the same
> result. Maybe we should accept some limits to the precision here, such
> as 16 bit integral value and 16 bit fractional one for all decimal
> numbers (as an example of course).
>
> ​
Or a simple parsing rule: 15 decimal digits, with an optional dot somewhere
in the middle.

That said, I don't think DPI is a great example; for one, because it
already exists (unless someone's planning to respecify it according to the
generic structure in future?), and for two, because it can be alternatively
stated as an integer number of dots per inch, which is the direction CSS
seems to be heading [1].

I'm not the most imaginative person, but I still can't come up with a
fractional number that isn't either a fixed-point number, an inverted
fraction, or bound to a unit, any of which can be turned into an integer by
restating the requirement (no hacking or kludging involved).  Which makes
me think that floats are convenient, but unnecessary.

Cheers

[1] https://drafts.csswg.org/mediaqueries-3/#resolution
-- 
  Matthew Kerwin
  http://matthew.kerwin.net.au/

Received on Thursday, 2 November 2017 23:41:19 UTC