![]() |
![]() |
|
![]() |
![]() |
Encyclopedia :
F :
FL :
FLO :
Floor function |
|
|
Floor functionIn mathematics, the floor function is the function defined as follows: for a real number 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 [x] or . A more traditional name for it is the integral part of x. The function x−[x], also written as x mod 1, is called the fractional part of x. Every fraction x ≥ 0 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 We always have The floor function is not continuous, but it is upper semi-continuous. If x is a real number and n is an integer, we have n ≤ x if and only if n ≤ floor(x). In fancy language: the floor function is part of a Galois connection; it is the upper adjoint of the function which embeds the integers into the reals. Using the floor function, one can produce several explicit (yet impractical) formulas for prime numbers. See the article on prime numbers for a number of examples. The ceiling function A closely related mathematical function is the ceiling function, 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 numbers into two sequences via the floor function. The operator (int) in C C and related programming languages have a feature called type casting which allows to turn a floating point value into an integer by prefixing it with Like the floor and ceiling function, this operation is not continuous, which can magnify rounding errors with disastrous consequences. For instance, 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 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
|
|
|
This article is from Wikipedia. All text is available under the terms of the GNU Free Documentation License. |
|
| © 2008 Chamas Enterprises Inc. |