Home

ceilmax2

ceilmax2 is a mathematical function that returns the smallest integer greater than or equal to the maximum of two input real numbers. Formally, ceilmax2(a, b) = ceil(max(a, b)).

A useful equivalent form is ceilmax2(a, b) = max(ceil(a), ceil(b)) for all real a and b. This follows

Key properties include commutativity, since ceilmax2(a, b) = ceilmax2(b, a), and its behavior for integers: if a

In computation, ceilmax2 can be implemented directly as ceil(max(a, b)) in most languages. An equivalent expression

Examples: ceilmax2(3.2, 4.7) = ceil(4.7) = 5. ceilmax2(-1.1, -2.9) = ceil(-1.1) = -1. If a = 2 and b = 5, ceilmax2(2,

Extensions of the concept include ceilmax_n for n inputs, defined as ceil(max(x1, x2, ..., xn)).

See also: ceiling function, maximum function, integer rounding.

from
the
monotonicity
of
the
ceiling
function
and
the
fact
that
the
maximum
of
the
two
inputs
governs
the
ceiling
value.
and
b
are
both
integers,
ceilmax2(a,
b)
equals
max(a,
b).
The
function
is
defined
for
real
numbers;
if
either
input
is
NaN,
the
result
is
typically
NaN
in
most
programming
contexts,
while
infinities
are
treated
according
to
the
usual
rules
for
max
and
ceil.
is
max(ceil(a),
ceil(b)).
Both
forms
are
mathematically
identical
for
finite
real
inputs.
5)
=
5.