Re: [csswg-drafts] [cssom-1][css-color-4] Move serialization of `<color>` and `<alpha-value>` (#9798)

> So with trailing zeroes omitted it should be serialized as "0.5", no?

50 * 2.55 = 127.5 but it is 127.499999... because of floating point precision. Rounded up, 127.5 is 128, which is not equal to 127, so the next branch of the algorithm applies.

To be honest, I cannot say I understand all the intricacies of this algorithm and the relation with unsigned 8-bit representation, but `0.498` is the result in Chrome and Firefox.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 31 January 2024 08:51:06 UTC