| Floor Function |
Article Index for Floor |
Website Links For Floor |
Information AboutFloor Function |
|
In ''x'', floor(''x'') is the largest Integer less than or equal to ''x''. For example, floor(2.9) = 2, floor(−2) = −2 and floor(−2.3) = −3. The floor function is also denoted by . For Nonnegative ''x'', a more traditional name for floor(''x'') is the integral part or '''integral value''' of ''x''. The function ''x''− {Link without Title} , also written as ''x'' Mod 1, is called the '''fractional part''' of ''x''. Every Fraction ''x'' can be written as a Mixed Number , the sum of an integer and a Proper Fraction . The floor function and fractional part functions extend this decomposition to all real values. SOME PROPERTIES OF THE FLOOR FUNCTION
:: :with equality on the left if and only if ''x'' is an integer.
:
THE CEILING FUNCTION A closely related mathematical function is the ceiling function, which is defined as follows: for any given real number ''x'', ceiling(''x'') is the smallest integer not less than ''x''. For example, ceiling(2.3) = 3, ceiling(2) = 2 and ceiling(−2.3) = −2. The ceiling function is also denoted by . It is easy to show the following: : and the following: : For any integer ''k'', we also have the following equality: : . If ''m'' and ''n'' are Coprime positive integers, then : Beatty's Theorem shows how every positive Irrational Number gives rise to a partition of the Natural Number s into two sequences via the floor function. THE OPERATOR <CODE>(INT)</CODE> IN C C and related Programming Language s have a feature called Type Casting which allows to turn a Floating Point value into an integer by prefixing it with (int). This operation is a mixture of the floor and ceiling function: for positive or 0 ''x'' it returns floor(''x''), and for negative ''x'' it returns ceiling(''x''). Like the floor and ceiling function, this operation is not continuous, which can magnify Rounding Error s with disastrous consequences. For instance, (int)(0.6/0.2) will return 2 in most implementations of C, even though 0.6/0.2 = 3. The reason is that computers work internally with the Binary Numeral System , and it is not possible to represent the numbers 0.6 and 0.2 by a finite binary string. So some rounding errors occur, and the result is computed as 2.999999999999999555910790149937 which the (int) operator will happily convert to 2. The POSIX floor() function has similar problems. Because of issues like these, most modern Calculator s use the decimal numeral system internally.THE FRACTIONAL PART If ''x'' is an Irrational Number , then the fractional parts ''nx'' mod 1, where ''n'' runs through the positive integers, are extremely evenly distributed in the Open Interval (0,1). This can be made precise in various ways, one of which states : for every and Integration ). According to a general principle of Diophantine Approximation discovered by Hermann Weyl , that property is equivalent to something much easier to check in this case: namely that sums : for fixed integers ''k'' > 0 and taken over ranges : 0 < ''n'' < ''N'' have estimates O(''N'') . Because these are Geometric Progression s, that can be proved rather directly. The condition that ''x'' be irrational comes out to be that : TRUNCATION While the floor function only outputs natural numbers, Truncation allows "cutting off the numbers" at a specified position. |
|
|