Re: [csswg-drafts] [css-values] Add round()/floor()/ceil() functions (#2513)

Since some authors are accustomed to Javascript/EcmaScript functions and the CSS WG strives for compatibility where possible and reasonable, here is a list of related standard methods of the `Math` object:

- [`round(number) = integer`](https://tc39.es/ecma262/#sec-math.round), round to nearest integer, or towards positive infinity if ambiguous
  - _preliminarily proposed_ [`roundBy(number, integer) = number`](https://github.com/rwaldron/proposal-math-extensions/issues/13), optional second parameter to specify number of decimal places
- [`fround(number) = float-32`](https://tc39.es/ecma262/#sec-math.round), rounding to nearest 32-bit single precision floating point number, or towards the next even number if ambiguous
- [`ceil(number) = integer`](https://tc39.es/ecma262/#sec-math.ceil), round up to next integer
- [`floor(number) = integer`](https://tc39.es/ecma262/#sec-math.floor), round down to next integer
  - _preliminarily proposed_ [`floor(number, integer)`](https://github.com/rwaldron/proposal-math-extensions/issues/11), optional second parameter to specify number of decimal places
- [`trunc(number) = integer`](https://tc39.es/ecma262/#sec-math.trunc), truncate to integral part


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

Received on Saturday, 14 December 2019 01:44:21 UTC