W3C home > Mailing lists > Public > public-css-archive@w3.org > December 2019

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

From: Christoph Päper via GitHub <sysbot+gh@w3.org>
Date: Sat, 14 Dec 2019 01:44:20 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-565668909-1576287859-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:57 UTC