# Talk:Floor and ceiling functions

Jump to: navigation, search
WikiProject Computer science (Rated C-class, Mid-importance)
This article is within the scope of WikiProject Computer science, a collaborative effort to improve the coverage of Computer science related articles on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
C  This article has been rated as C-Class on the project's quality scale.
Mid  This article has been rated as Mid-importance on the project's importance scale.
WikiProject Mathematics (Rated B-class, Mid-importance)
This article is within the scope of WikiProject Mathematics, a collaborative effort to improve the coverage of Mathematics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Mathematics rating:
 B Class
 Mid Importance
Field: Basics

## Formula disrupts article flow

If m and n are coprime integers, then

1≤in-1 floor(im/n) = (m-1)(n-1)/2.

This identity doesn't in any way help understanding what the floor function is. Nor is it somthing special: there are probably dozens of identities involving the floor function. It disrupts the flow of the article. If you want to include it, please explain why you want to on this page before doing so and try to fit it in with the rest of the article. -- Arvindn 13:57 Dec 23, 2002 (UTC)

If there are dozens of identities involving the floor function, then they should all be listed in this article. Suppressing information certainly doesn't help the reader. But I agree with you that it was disrupting the flow of the article. AxelBoldt 03:14 Dec 24, 2002 (UTC)

## same as truncation?

Isn't the floor function just a specific case of truncation? (i.e., truncating the number back to the decimal point)   –radiojon 02:14, 2005 Apr 20 (UTC)

Not over its entire domain -- floor(-2.3) is -3, however the truncation of -2.3 is -2. -- 20:47, 14 September 2005 (UTC)

## Ceiling function

Why is the ceiling function here? It should be in its own article!! It's like having an article about males in the female article... Enochlau 14:30, 15 Jun 2005 (UTC)

Ceiling function redirects to this article. I think it's safe to say they're similar enough to warrant their current cohabitation. -- 20:47, 14 September 2005 (UTC)

## Derivative

${\displaystyle {d \over dx}\lfloor x\rfloor =0}$

With the exception of discontinuities. -- 20:47, 14 September 2005 (UTC)

And those discontinuities are represent-able as (x - [x])/(x - [x]) which has led many to try to see the results of just making it 0. It /is/ interesting but probably not worthwhile in a wiki article at this current time.
TheGreatDuckINH (talk) 17:55, 7 March 2016 (UTC)

The representation as a ratio would depend on the limit being taken, e.g., central derivative vs. other. Regardless, a 0/0 formulation is not equivalent to "just making it 0". This would need citations before we could add something to the article. 𝕃eegrc (talk) 18:35, 7 March 2016 (UTC)

Whoa whoa whoa. You completely misread what I just said. I said that it's discontinuity is expressed as a polynomial fraction. Some people (usually weird people doing very weird things) try to look at results of saying it is zero as an incorrect premise. Like I even said, it doesn't belong in article. So I don't see why you need to follow me around trying to say I'm wrong when I already told the person above me that the edit does not belong.
TheGreatDuckINH (talk) 19:29, 7 March 2016 (UTC)

I have a watchlist that tells me when pages I am interested in are edited. It alerted me to your edits. I apologize that it looked like I was following you around and I apologize for misinterpreting your message. 𝕃eegrc (talk) 15:22, 8 March 2016 (UTC)

## Article name

The three functions discussed on the article page definitely should be in the same article, but the article name is slightly misleading. Can I suggest that whatever the collective term is for these functions be used? I'd move the page myself but I wouldn't know what to move it to. Neonumbers 02:13, 27 May 2006 (UTC)

I don't think there really is an agreed upon name for them.
TheGreatDuckINH (talk) 19:31, 7 March 2016 (UTC)
Have you noticed that you are responding to remarks that are more than 9 years old? --JBL (talk) 20:19, 7 March 2016 (UTC)

## Nitpick

"Continuous" is a dangerous word to use in computer science, since nothing is analogue. --VKokielov 05:18, 18 July 2006 (UTC)

## Rename to rounding function

The following discussion is an archived debate of the proposal. Please do not modify it. Subsequent comments should be made in a new section on the talk page. No further edits should be made to this section.

The result of the debate was Move to Floor and ceiling functions Duja 09:47, 13 December 2006 (UTC)

• I oppose. Rounding is something different than these: reducing the precision in the most accurate way possible. I could somewhat see including rounding here, but I would object to that too. Baccyak4H 03:47, 22 September 2006 (UTC)
Update. After reading Omegatron's vote, I realized I was not clear with my intention. I oppose merging, under the condition that rounding functions becomes a category, not an article. Then floor, ceiling, round (others?) would be individual articles, with appropriate crosslinks. Under this organization, I would support a skeleton article on rounding functions which would read like a disambiguation page, with links to the specific functions. Although the Categories:rounding_functions page might fit this bill. Baccyak4H 14:13, 22 September 2006 (UTC)
What are you going to put in ceiling function that's so unique from floor function that it deserves its own article? We don't have separate articles for sine, cosine, and tangent for the exact same reason. — Omegatron 22:45, 22 September 2006 (UTC)
Well, I would argue maybe we should. Clearly most specifics written about floor/ceiling are specific to them only. The spirit may be similar, yes, but not the specifics (exception: derivatives, which are some Dirac delta type animal...). But I have made my case, as have you, and others. I accept the community's wisdom. And yes, there are a lot of other controversies in WP that are far more problematic. If the page is merged like the trig page, I still feel it can work well, although some cleanup/reorg might be needed. Baccyak4H 03:46, 23 September 2006 (UTC)
I oppose the move too, for the same reason. Oleg Alexandrov (talk) 04:36, 22 September 2006 (UTC)
• Support - Floor function is of course the wrong title for this article, which covers several rounding methods. — Omegatron 05:01, 22 September 2006 (UTC)

Discussion A better name could then be floor and ceiling functions.

The redlink rounding function should rather redirect to rounding. Note that floor and celing functions are very particular cases of rounding, namely rounding to integers. Oleg Alexandrov (talk) 15:22, 22 September 2006 (UTC)

Integer rounding functionOmegatron 22:45, 22 September 2006 (UTC)
That should be Integer rounding functions (plural). But I find that name to be too clumsy, and I think floor and ceiling functions better reflects what's in the article. Oleg Alexandrov (talk) 02:42, 23 September 2006 (UTC)
This somewhat reflects why individual pages would be a plus (see above). But given the choices presented, note that neither Integer rounding functions (plural) nor floor and ceiling functions could include rounding, as this is not necessarily "integer".
How about "Truncation functions"? I am not wed to this name, just wanted to see what everyone thought. Baccyak4H 03:53, 23 September 2006 (UTC)
Rounding 4.6 up to 5 is not truncation. — Omegatron 00:50, 25 September 2006 (UTC)
Very good point. Although now that you mention that, it seems "rounding functions" suffers from the same drawback, say, floor(4.6). I like neither now, but "rounding" does seem the lesser evil. Can we do better? Baccyak4H
• Oppose/support. I oppose the suggested name, but I strongly support a rename of the article. Regarding the suggested name, as previously said, neither floor, nor ceiling is a rounding function. The only rouding function is round... You might call this article Integral conversion functions, but round should be included as well in that case. A good suggestion already made is simply Floor and ceiling functions, along with the relevant redirects from Floor function and Ceiling function. — Sagie 16:03, 17 October 2006 (UTC)
I saw somewhere a redirect or reference to "discretization"; I would perhaps consider "discretization functions" as an alternate renaming. Advantage: covers all types of functions discussed. Disadvantage: ugly name. Comments? Baccyak4H 16:19, 17 October 2006 (UTC)
• Comment - It would make much more sense to split to floor function and ceiling function. They are similar in functionality (both round) but are diametrically different. I found it, for a lack of a better word, "disturbing" that I was redirected to an article entitled "floor function" when I was looking for the ceiling function. The proposition of renaming the article also addresses the problem of having the ceiling and floor functions cohabitating the same article. Just as well combine war and peace. Cburnett 01:57, 12 November 2006 (UTC)
No. War and peace are opposites. The floor and ceiling function are the same thing, but in different directions. I don't know how anyone could think they belong in different articles. Wikipedia articles are about a topic, not a word. — Omegatron 04:24, 10 December 2006 (UTC)
• Strong oppose. Floor function should keep its status as a title, as Wolfram MathWorld uses it in their title. Also split the articles into ceiling function. Sr13 07:49, 21 November 2006 (UTC)
This is Wikipedia, not Wolfram MathWorld. — Omegatron 14:56, 5 December 2006 (UTC)
• Oppose The rounding function is something else, Floor(x+ .5) or similar. Splitting is probably unnecessary, since all this says about the ceiling function is its relationship to the floor function. Septentrionalis 21:14, 5 December 2006 (UTC)

## Rename

No no no. Vote like this. Which titles do you like best for this article? Note that it currently covers the floor function, ceiling function, and int function.

Feel free to add additional names, if you support them; we don't need more choices nobody likes. Septentrionalis PMAnderson 16:38, 11 December 2006 (UTC)
Exactly. — Omegatron 16:41, 11 December 2006 (UTC)

### Floor function

1. Keep things simple. Septentrionalis PMAnderson 16:35, 11 December 2006 (UTC)
I'd consider this "keeping things confusing", since the article is about three related functions. — Omegatron 16:41, 11 December 2006 (UTC)

### Rounding functions

1. Omegatron 04:23, 10 December 2006 (UTC)

### Floor and ceiling functions

1. Omegatron 04:23, 10 December 2006 (UTC)
2. GTBacchus(talk) 23:20, 10 December 2006 (UTC)
3. - With redirects Patstuarttalk|edits 06:22, 11 December 2006 (UTC)
4. Nothing really wrong with this; but it does need the redirects. Septentrionalis PMAnderson 16:37, 11 December 2006 (UTC)

### Discretization functions

The above discussion is preserved as an archive of the debate. Please do not modify it. Subsequent comments should be made in a new section on this talk page. No further edits should be made to this section.

## Error in function definition

Although the floor and ceiling functions are defined for all real values (of x), the definitions

    max { n [in] R : n <= x }


and

    min { n [in] R : n >= x }


do not restrict "n" to integral (integer) values. As defined in the article, the functions would always return the value x!

The necessary correction is to have n come from the set of integers, Z, rather than the set of real numbers, R:

    max { n [in] Z : n <= x }


and

    min { n [in] Z : n >= x }.


StarboardSouthpaw (talk) 17:59, 16 June 2008 (UTC)

## One formula is false

• When x and n are positive numbers
${\displaystyle \left\lfloor {\frac {n}{x}}\right\rfloor \geq {\frac {n}{x}}-{\frac {x-1}{x}}}$

If n=9.5, x=5

${\displaystyle \left\lfloor {\frac {n}{x}}\right\rfloor =1}$
${\displaystyle {\frac {n}{x}}-{\frac {x-1}{x}}=1.9-0.8=1.1}$

Maksim-e (talk) 20:09, 29 July 2008 (UTC)

I've changed numbers to integers. Richard Pinch (talk) 19:45, 16 August 2008 (UTC)

## ANSI C

I've commented out a description of truncation -- ANSI C does not prescribe a direction to round in. Richard Pinch (talk) 19:46, 16 August 2008 (UTC)

The C99 standard (section 6.3.1.4) requires truncation towards 0. McKay (talk) 22:52, 2 April 2009 (UTC)

## Computer implementations

Needs more references -- I've tagged with refimprove. Richard Pinch (talk) 21:35, 26 August 2008 (UTC)

## Fractional Part Cleanup

The current state of the article is a Frankenstein's Monster reflecting both a time when the fractional part function was defined in the introduction, and now, when it has been moved to the Applications section. For example, the sentence in which the fractional part function is first defined begins "As stated above, ..." I propose putting all the fractional part material in the Applications section, including the fractional part properties. Thoughts? DRE (talk) 21:26, 8 September 2009 (UTC)

## Truncation merge

It was proposed, about 29 months ago, that Truncation be merged into this article. I think it's a good idea, but no discussion was actually opened. — Arthur Rubin (talk) 19:38, 12 March 2011 (UTC)

• Weak disagree. They are slightly different concepts. But more problematic is the if the article should then be renamed to fit in all the concepts. With a third topic, would the article need to be renamed from Floor and ceiling functions to Floor, ceiling and truncation functions? +mt 22:52, 12 March 2011 (UTC)
• Agree. Basically the entire truncation article could be folded into the truncation subsection of this article with minimal effort; the title of this article would not need to change. --Joel B. Lewis (talk) 00:46, 3 July 2011 (UTC)

## Spreadsheets

Wikipedia is not a manual for Excel or other package. I propose to delete that section of the article. McKay (talk) 06:56, 5 September 2011 (UTC)

## Inverse

What is the inverse function of these functions, if it even exists? Either way, this info should be added to the article. --93.141.51.184 (talk) 16:36, 22 January 2012 (UTC)

Since all of these functions are piecewise constant, none of them has an inverse function. Just look at the graph! --Joel B. Lewis (talk) 16:43, 22 January 2012 (UTC)

## Naked assertion

"None of the formulas in this section is of any practical use."

Very entertaining statement, one that to some would make the section even more worthwhile. Too bad it is impossible to prove. Pressed to correct it, one might substitute the weaker but less objectionable, "Perhaps one day some formula in this section will become something other than a useless curiosity." 129.176.151.28 (talk) 06:02, 13 February 2013 (UTC)129.176.151.28 (talk) 17:18, 13 February 2013 (UTC)

It is absolutely true that none of the formulas is of any practical use. That statement is not contradicted by the assertion that some day someone may find a use for one of them, because it does not say "..and never will be of any practical use". However, it is very difficult to imagine any way that any such formula ever could be of any use. JamesBWatson (talk) 20:55, 15 February 2013 (UTC)
We have given this rather more discussion than it deserves but I stand by my assertion and suggest that you have a tough row to hoe in trying to contradict it. I would suggest that you adopt my position: keep the disputed statement; it's entertaining, quite likely correct, and in any event a harmless comment about something that is tangential to the thrust of the article.129.176.151.28 (talk) 00:31, 23 February 2013 (UTC)

I referenced the claim from a reliable source (Ribenboim) I think Crandall and Pomerance say pretty much the same thing - Virginia-American (talk) 12:16, 23 February 2013 (UTC)

## Unlabelled Axes

Graphs with unlabelled axes are meaningless, so could someone please fix the three meaningless graphs in this article. Readers should not have to guess what the graphs are supposed to mean as they may guess wrongly!86.140.5.138 (talk) 13:55, 29 March 2014 (UTC)

## Meaning of equivalence

In the section Floor and ceiling functions#Mod operator, could somebody please explain in what mathematical sense the equivalence below is true?

If x is an integer and y is a positive integer,

${\displaystyle (x\,{\bmod {\,}}y)\equiv x{\pmod {y}}.}$

As far as I can tell, there is no equivalence defined in this article. We are therefore left to guess at which equivalence is meant; this is not a recipe for accuracy. If one should suggest that it is an equivalence of integers modulo y, that would seem to be circular; or if we are to understand it in terms of the mod operator defined here, surely it becomes trivial? Yoyo (talk) 04:03, 18 June 2015 (UTC)

Yes equivalence mod y, not circular, yes trivial (though not, perhaps, for the reason you wrote). Doubtful that it belongs in this article (about the floor function), right? --JBL (talk) 12:36, 18 June 2015 (UTC)
I just decided to get rid of it. --JBL (talk) 12:47, 18 June 2015 (UTC)

## Is the formular for rounding away from zero correct?

Hi there, the formula for the rounding away from zero function ri(x) in this article's section Floor and ceiling functions#Rounding is claimed to be

${\displaystyle {\text{ri}}(x)=\operatorname {sgn}(x)\left\lfloor |x|+{\tfrac {1}{2}}\right\rfloor }$,

while in article Rounding#Rounding to integer the respective general formula is

${\displaystyle q=\operatorname {sgn}(y)\left\lceil \left|y\right|\right\rceil =-\operatorname {sgn}(y)\left\lfloor -\left|y\right|\right\rfloor \,}$

and the particular formula for rounding half away from zero:

${\displaystyle q=\operatorname {sgn}(y)\left\lfloor \left|y\right|+0.5\right\rfloor =-\operatorname {sgn}(y)\left\lceil -\left|y\right|-0.5\right\rceil \,}$.

So it might be useful to explain more precisely to which of both cases this article's rounding away from zero function applies. Apparently to the latter, and in this case its name shouldn't be just ri(x), but maybe rhi(x)? --Qniemiec (talk) 18:46, 2 May 2016 (UTC)

In the other article, it describes "rounding away from 0", then later describes "rounding to the nearest integer, with tiebreaking rules" (where one possible tiebreaking rule is "round away from 0"). In this article, it describes "round to the nearest integer, with tiebreaking rules" (and ditto). I do not think inventing new notations is a good solution in this situation, but perhaps there are other ways to make it clearer? --JBL (talk) 16:02, 4 May 2016 (UTC)

## Inclusion of floor(x+y) and ceil(x+y)

Hello, I would like to propose an edit that would include following formulas

{\displaystyle {\begin{aligned}\lfloor x+y\rfloor &=\lfloor x\rfloor +\lfloor y\rfloor +\lfloor \{x\}+\{y\}\rfloor ,\\\lceil x+y\rceil &=\lfloor x\rfloor +\lfloor y\rfloor +\lceil \{x\}+\{y\}\rceil \end{aligned}}}[1]

to section 'Equivalences'. Although there are two similar inaqualities already present in the section I believe 'my' equations to be more precise. One of them can be found in Graham, Knuth, Patashnik on p. 70, right above chapter 3.2 FLOOR / CEILING APP., with the other derived likewise.

References

1. ^ Graham, R.; Knuth, D.; Patashnik, O. (1990). Concrete Mathematics (6. ed.). Addison-Wesley Publishing Company. p. 70.

--Martin Menkyna (talk) 09:56, 15 November 2016 (UTC)

No problem, afaiac go ahead. Don't forget to include the ISBN of the book. - DVdm (talk) 11:50, 15 November 2016 (UTC)