- From: Guillaume via GitHub <sysbot+gh@w3.org>
- Date: Thu, 07 Jul 2022 19:26:27 +0000
- To: public-css-archive@w3.org
cdoublev has just created a new issue for https://github.com/w3c/csswg-drafts: == [css-syntax-3][css-values-4] Add informative note about tokenization of negative 0 == I cannot tell which behavior is "right", if there is one, and I cannot think of an example for which it could matter, but I feel like an informative note (something like the note removed in this [commit](https://github.com/w3c/csswg-drafts/commit/3eeafc30400155ab02e7934c522689ec06f9af1b#diff-fc1c32de78d227c8f0c8008469824444d1ba7f027e48a336125017d40b8f6f6fL3463)) about removing the sign of `0⁻` in [*convert a string to a number*](https://drafts.csswg.org/css-syntax-3/#convert-a-string-to-a-number) is required, especially in regards to calculations because a consequence is that `calc(1 / -0)` is `calc(infinity)` instead of `calc(-infinity)`, which matches the output in JS, which [*performs division according to the rules of IEEE 754-2019*](https://tc39.es/ecma262/multipage/ecmascript-data-types-and-values.html#sec-numeric-types-number-divide), whereas in [Type Checking (CSS Values)](https://drafts.csswg.org/css-values-4/#calc-type-checking): > Math functions follow IEEE-754 semantics for these operations > > - Dividing a positive value by zero produces +∞. > - Dividing a negative value by zero produces −∞. > > [...] > > In other words, multiplying or dividing with 0⁻ follows standard sign rules Can you also please tell me if there is any other difference between *convert a string to a number* and JS `Number()`, please? Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7472 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 7 July 2022 19:26:29 UTC