Re: [csswg-drafts] [css-values] Allow sqrt(<length-percentage>) (#3764)

> Why would `pow(-8, 1/3)` ever return NaN?

Probably because the principal root is complex, `2 e^((i pi) / 3)`. There is also the real root `-2`, but `1/3` is stored as a floating point number, which probably is not exactly the mathematical `1/3`. If you add some error, the real solution may disappear.

But with `root(-8, 3)`, now `3` can be required to be an integer, avoiding precision problems. Then we can know whether there is a real root or not.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3764#issuecomment-476881179 using your GitHub account

Received on Tuesday, 26 March 2019 22:42:32 UTC