W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2020

Re: [csswg-drafts] [css-values-4] Should arguments to min/max get simplified when only partial simplification is possible? (#4756)

From: Oriol Brufau via GitHub <sysbot+gh@w3.org>
Date: Tue, 03 Mar 2020 23:45:53 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-594229751-1583279152-sysbot+gh@w3.org>
But how do you decide which functions should be special-cased with this arguments simplifications? For example `hypot()` could be a candidate since mathematically

```
hypot(x, y, z) = hypot(hypot(x, y), z)
```

The problem is that in practice there can be a loss of precision, e.g. with JS in Firefox I get

```js
Math.hypot(0, 1, 5);             // 5.099019513592785
Math.hypot(Math.hypot(0, 1), 5); // 5.0990195135927845
```

So, if this simplification is added only to `min()` and `max()`, will authors also expect it for `hypot()`? And if it's also added to `hypot()`, will authors expect the precision loss?

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4756#issuecomment-594229751 using your GitHub account
Received on Tuesday, 3 March 2020 23:45:55 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:02 UTC