Terminal emulator with all the bells and whistles https://www.enlightenment.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
431 B

// DIV_ROUND_UP
@@
expression n, d;
@@
(
- (((n + d) - 1) / d)
+ DIV_ROUND_UP(n, d)
|
- ((n + (d - 1)) / d)
+ DIV_ROUND_UP(n, d)
)
// ROUND_UP
@@
expression n, d;
@@
(
- ((((n + d) - 1) / d) * d)
+ ROUND_UP(n, d)
|
- (((n + (d - 1)) / d) * d)
+ ROUND_UP(n, d)
|
- (DIV_ROUND_UP(n,d) * d)
+ ROUND_UP(n, d)
)
// MIN / MAX
@@
expression x, y;
@@
(
- (((x) > (y)) ? (y) : (x))
+ MIN(x, y)
|
- (((x) > (y)) ? (x) : (y))
+ MAX(x, y)
)