Re: [csswg-drafts] [css-syntax][css-values] Add IEEE 754 float hex format SVG/CSS values (#4564)

To keep the discussion in one place, here's [my reply]( from when this request was [originally posted to the www-svg mailing list](

Key points (beyond suggesting filing it here):

> I can see a few obstacles:
> - SVG currently only [requires single-precision floats](, not double.  CSS doesn't currently specify precision requirements; there is an open issue suggesting that it should be formally made undefined behavior (#4552). 
> - <del>The `#nnnnnnnn` format is already used in CSS and SVG for colors. Parsing would be ambiguous in some CSS properties.</del> *[Edit: this issue is addressed by using an 0x syntax]*
> - CSS (and SVG) are mostly harmonizing with JavaScript (ECMAScript) for any new Math-related features, and JavaScript doesn't have any hex-based formats for floats. *[Edit: the 0x syntax is a problem from this perspective, since in JavaScript it is always interpreted as an integer, not a float!]*
> You might get more support for a request to specify the parsing/rounding rules for converting between decimal representation and binary floats (which would most likely match the [ECMAScript specification](, and use the "round to nearest, with ties to even" rule). With this guaranteed, you could be confident that a decimal version of a number would always parse into the same binary representation. But first, the precision level (single or double float) would need to be defined.

GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at using your GitHub account

Received on Thursday, 5 December 2019 22:59:22 UTC