Home

wholepart

Wholepart is a term used to describe the integer part of a real number—the portion of the number that is a whole number, independent of any fractional component. In formal mathematics, this concept is most clearly captured by the floor function, denoted ⌊x⌋, which returns the greatest integer less than or equal to x. For example, ⌊12.34⌋ = 12 and ⌊-2.7⌋ = -3.

In some programming and teaching contexts, the term wholepart is used more loosely to refer to truncation

Mathematically, the floor function ⌊x⌋ is a nondecreasing, integer-valued function that is discontinuous at every integer.

In practical use, wholepart appears in number theory, digital representations, measurements, and data processing, where separating

toward
zero,
where
the
fractional
part
is
discarded
without
adjusting
the
sign.
Under
this
interpretation,
-2.7
would
be
represented
as
-2.
The
choice
between
floor
and
truncation
affects
derived
quantities
such
as
the
fractional
part,
which
can
be
defined
as
x
−
⌊x⌋
in
the
floor
convention,
or
x
−
trunc(x)
in
the
truncation
convention.
It
satisfies
⌊x⌋
≤
x
<
⌊x⌋
+
1
for
all
x.
The
concept
is
closely
related
to
the
fractional
part
{x}
=
x
−
⌊x⌋,
which
measures
how
far
x
is
from
the
preceding
integer.
an
amount
into
whole
units
and
a
remainder
is
needed.
In
computing,
many
languages
implement
this
operation
in
two
ways:
flooring
(as
in
math
libraries)
or
truncation
toward
zero
(as
in
type
casting
to
integers).