The fractional part or decimal part of a non‐negative
real number
In mathematics, a real number is a number that can be used to measure a ''continuous'' one-dimensional quantity such as a distance, duration or temperature. Here, ''continuous'' means that values can have arbitrarily small variations. Every real ...
is the excess beyond that number's
integer part
In mathematics and computer science, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least int ...
. If the latter is defined as the largest integer not greater than , called
floor of or
, its fractional part can be written as:
:
.
For a
positive number
In mathematics, the sign of a real number is its property of being either positive, negative, or zero. Depending on local conventions, zero may be considered as being neither positive nor negative (having no sign or a unique third sign), or it ...
written in a conventional
positional numeral system
Positional notation (or place-value notation, or positional numeral system) usually denotes the extension to any radix, base of the Hindu–Arabic numeral system (or decimal, decimal system). More generally, a positional system is a numeral syste ...
(such as
binary
Binary may refer to:
Science and technology Mathematics
* Binary number, a representation of numbers using only two digits (0 and 1)
* Binary function, a function that takes two arguments
* Binary operation, a mathematical operation that ta ...
or
decimal
The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers of the Hindu–Arabic numeral ...
), its fractional part hence corresponds to the digits appearing after the
radix point
A decimal separator is a symbol used to separate the integer part from the fractional part of a number written in decimal form (e.g., "." in 12.45). Different countries officially designate different symbols for use as the separator. The choi ...
. The result is a real number in the half-open
interval
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 , or as the part of the number to the right of the radix point , or by the Weisstein,_Eric_W._"Fractional_Part."_From_MathWorld--A_Wolfram_Web_Resource/ref>
:
with_
_as_the_smallest_integer_not_less_than_,_also_called_the_
:Weisstein,_Eric_W._"Fractional_Part."_From_MathWorld--A_Wolfram_Web_Resource/ref>
:
with_
_as_the_smallest_integer_not_less_than_,_also_called_the_ceiling_function">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
: