Fractional part explained

x

is the excess beyond that number's integer part. The latter is defined as the largest integer not greater than, called floor of or

\lfloorx\rfloor

. Then, the fractional part can be formulated as a difference:

\operatorname{frac}(x)=x-\lfloorx\rfloor,x>0

.

For a positive number written in a conventional positional numeral system (such as binary or decimal), its fractional part hence corresponds to the digits appearing after the radix point. The result is a real number in the half-open interval [0, 1). ==For negative numbers== However, in case of negative numbers, there are various conflicting ways to extend the fractional part function to them: It is either defined in the same way as for positive numbers, i.e., by <math>\operatorname{frac} (x)=x-\lfloor x \rfloor</math> {{harv|Graham|Knuth|Patashnik|1992}},<ref>{{citation | title=Concrete mathematics: a foundation for computer science | first1=Ronald L. | last1=Graham | author-link1=Ronald Graham | first2=Donald E. | last2=Knuth | author-link2=Donald Knuth | first3=Oren | last3=Patashnik | author-link3=Oren Patashnik | publisher=Addison-Wesley | isbn=0-201-14236-8 | year=1992 | page=70 }}</ref> or as the part of the number to the right of the radix point <math>\operatorname{frac} (x)=|x|-\lfloor |x| \rfloor</math> {{harv|Daintith|2004}},<ref>{{citation|title=A Dictionary of Computing|first=John|last=Daintith|date=2004|publisher=Oxford University Press}}</ref> or by the [[odd function]]:[2]

\operatorname{frac}(x)=\begin{cases} x-\lfloorx\rfloor&x\ge0\\ x-\lceilx\rceil&x<0 \end{cases}

with

\lceilx\rceil

as the smallest integer not less than, also called the ceiling of . By consequence, we may get, for example, three different values for the fractional part of just one : let it be −1.3, its fractional part will be 0.7 according to the first definition, 0.3 according to the second definition, and −0.3 according to the third definition, whose result can also be obtained in a straightforward way by

\operatorname{frac}(x)=x-\lfloor|x|\rfloorsgn(x)

.

The

x-\lfloorx\rfloor

and the "odd function" definitions permit for unique decomposition of any real number to the sum of its integer and fractional parts, where "integer part" refers to

\lfloorx\rfloor

or

\lfloor|x|\rfloorsgn(x)

respectively. These two definitions of fractional-part function also provide idempotence.

The fractional part defined via difference from ⌊ ⌋ is usually denoted by curly braces:

\{x\}:=x-\lfloorx\rfloor.

Relation to continued fractions

Every real number can be essentially uniquely represented as a continued fraction, namely as the sum of its integer part and the reciprocal of its fractional part which is written as the sum of its integer part and the reciprocal of its fractional part, and so on.

See also

Notes and References

  1. Web site: Decimal part. https://web.archive.org/web/20180215143935/https://en.oxforddictionaries.com/definition/decimal_part. dead. February 15, 2018. Oxford Dictionaries. 2018-02-15.
  2. http://mathworld.wolfram.com/FractionalPart.html Weisstein, Eric W. "Fractional Part." From MathWorld--A Wolfram Web Resource