Talk:Floor and ceiling functions/Archive 1

Latest comment: 5 years ago by Spitzak in topic ISO codes
Archive 1

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

 

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)

Integer rounding functions

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)

Truncation functions

Integral conversion functions

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
 

If n=9.5, x=5

 
 

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,

 

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

 ,

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

 

and the particular formula for rounding half away from zero:

 .

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

 [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)

Bad source for prime test

This was a good edit by user Roger Hui (talk · contribs). Thanks! However, the cited source says something quite different. Our article now says:

 

which seems correct. But the cited source (first edition, 2001) on page 46 says:

 

which also seems correct. The 2nd edition, 2006, on page 50 of the book says the same. Do we have a source that backs the article's version? It does look far superior—and, looking at the summation limit, more "useful", so I suggest we either find a source, or, keeping the content, we remove the current source. Or of course, add the source's version to the article. - DVdm (talk) 07:45, 7 June 2018 (UTC)

Unless a source is found for the exact formula in the article, I suggest we keep the reference to Crandall and Pomerance, possibly modified to say that the article formula is based on it. Roger Hui (talk) 14:31, 7 June 2018 (UTC)
Yes, but that would be sort of wp:OR, even if it's trivial, and surely wp:CALC does not apply here. Unless of course we all agree here and just wp:IAR  . - DVdm (talk) 14:36, 7 June 2018 (UTC)
A bit of history: the form this took originally in the article was the Crandall--Pomerance form. In this edit from February 2015, Thedoctor73 changed the upper bound from infinity to n. The (erroneous) version was introduced in this edit by an IP user in August 2015, and has been there for the last three years. I personally would advocate for either the Crandall--Pomerance version or the simpler Thedoctor73 version (on the grounds that that simplification really is straightforward). It is definitely not good to have a false citation for the current (corrected) form. While the current form is in some sense more efficient than the C--P form, neither one is usable in practice so who cares? --JBL (talk) 16:03, 7 June 2018 (UTC)
Aside from wp:OR (really? that is research?), the CP version has the advantage that (a) it works for all n whereas the current formula requires saying that n>1; and (b) it corresponds more closely to the fact that a prime is a number which is divisible by exactly two different divisors (  can be read as "m divides n"). The current formula has the advantage that (a) it has another use of floor, a not insignificant advantage in an article on floor and ceiling; (b) it makes the point that you only need to use trial divisors ≤ sqrt(n) and is useful in practice. Roger Hui (talk) 16:49, 7 June 2018 (UTC)
Yes, certainly it's OR. (The fact that it was wrong and undetected for 3 years is a good reason things should be supported by valid citations!) Roger Hui's list of reasons seems pretty clearly lopsided to me, and I have changed it back to the version of February 2015. --JBL (talk) 19:40, 7 June 2018 (UTC)
But but but  ... in the CP reference it used ∞ as the upper limit on the sum, and here it says n. If you are going to change that upper limit (“original research”), why not change it to  . I am also thinking that perhaps the article should say explicitly that the summand is more understandable when interpreted as “m divides n”. -- Roger Hui (talk) 20:25, 7 June 2018 (UTC)
Smiling along, and agreeing that we change the upper limit to infinity, as in the source. I also moved the ref to the sentence preceeding the formula (as is usually done), and added the other condition to a footnote. If we have wp:consensus here that this is correct, there should be no problem. - DVdm (talk) 08:43, 8 June 2018 (UTC)
I like how it's now done, by stating the alternative in the note/reference. I added the additional requirement that n be greater than 1 in the note/reference. -- Roger Hui (talk) 14:32, 8 June 2018 (UTC)
Looks good to me. --JBL (talk) 19:09, 8 June 2018 (UTC)

prime test

 

I've added:

Equivalently,   This is correct because:   is equal to 1 if m divides n, and to 0 otherwise, as can be seen immediately. q.e.d. maimonid (talk) 11:40, 6 January 2019 (UTC)

See wp:UNSOURCED and wp:NOR. See also wp:CALC and wp:CONSENSUS. - DVdm (talk) 11:43, 6 January 2019 (UTC)
@DVdm: Do you systematically paralyze any attempt to improve Wikipedia articles with wp:Unsourced ? It is a very bad practice to do so. You are missing the point of Wikipedia. Sources are demanded only when you have a real reason to disagree with a contributor, not because the contributor has not cited his sources. In the case of this article for example, there are full of non cited assertions (e.g. near the beginning of the article). The usual and good way to proceed is to clarify things in the discussion page, or to put a "citation needed" in the article. maimonid (talk) 11:58, 6 January 2019 (UTC)
And, of course, wp:BURDEN. - DVdm (talk) 12:14, 6 January 2019 (UTC)
I've not restored the assertion you've deleted. So this has nothing to do with that. I think you answer like a robot (or more precisely, you don't answer, like a robot), so, you are probably a robot, an I have to stop this discussion. maimonid (talk) 12:23, 6 January 2019 (UTC)
@Maimonid: I agree that DVdm's responses are not very constructive. Here is a more helpful response: there is a discussion in the section directly above this one of the reasons for writing the article in its present form. Before making changes, it would be good to engage with the discussion there -- there are very good reasons not to make the change you suggest, relating to core principles of Wikipedia, as well as to reasonable choices about writing and presentation. Also, the form you've written down does not have clear meaning when n = 1, which is problematic. --JBL (talk) 17:43, 6 January 2019 (UTC)
@Joel B. Lewis:. Thank you for answering me. Indeed, this was discussed just above, and in fact the formula with   reported in the footnotes is exactly the same. Nevertheless, the formula with the infinite bound is very misleading (and the discussion above shows I'm not the only person to think so), as it causes to think there is a limit process while the formula is quite trivial. I may add a small hint that fix that. maimonid (talk) 21:20, 6 January 2019 (UTC)
@Maimonid: You are welcome. I was worried in your original edit about giving too much weight to this one not-important formula, but I think the current formulation avoids that problem nicely. --JBL (talk) 18:19, 8 January 2019 (UTC)

ISO codes

I wanted to type the floor function symbols but, although I knew they existed, they were rather hard to find with Google. I even clicked on Wikipedia's Floor and ceiling functions page! Ha. Fat chance that the "new" Wiki would actually have what I'm looking for!  :-)

This is a test. I've added something useful to the page and have a bet with myself that some Wiki editor will find reason to remove my change without finding an alternate way to provide the same useful information. What do I win? Jamesdowallen (talk) 08:25, 28 January 2019 (UTC)

If you'd spent half as much time making your edit decent (correctly placed, correctly formatted, on topic) instead of writing this dickish message, I wouldn't have had to fix it for you. You're welcome. --JBL (talk) 12:00, 28 January 2019 (UTC)

Thank you very much, JBL. And, FTR, I 'd be more motivated to spend time improving Wikipedia if moronic and overly-pedantic editors didn't thoughtlessly revert my changes so often. I notice you didn't add the ceiling codes. I'll do that now that you've pointed the way. Thanks again! Jamesdowallen (talk) 16:18, 28 January 2019 (UTC)

Those are not "ISO codes". They are the decimal values of the Unicode code points, used by HTML character entities. You can use the hex values into a HTML character entity by typing &#x<hex>; most of Unicode is defined using the hex number not the decimal one so this is preferred. I put examples in to replace the other text which did not format correctly anyway. May want to add (using &amp; to get it to print correctly) the source, but please use the hex value.Spitzak (talk) 19:05, 28 January 2019 (UTC)

There is some message board software which DOES support the decimal codes but does NOT support the hexadecimal codes. I intervened on this page NOT because I had some theoretical idea of what the page 'should' look like, but because, as an ACTUAL Wiki user I found that the page did NOT serve my needs. I wanted the codes because I was composing a message-board post and was surprised to find the codes so hard to come by. (It was low-priority; I actually ended up rewording that post to avoid the need for floor symbols ::whack::) I tried to copy/paste the floor symbols. Doesn't work -- they're all* images. (Why? Do you use images for objects like the word 'the'?  :-) )

I DO know how to convert hexadecimal to decimal, but I did not wade through the Wiki article to find the one place where the useful information was available. Easy, obviously needed, information should be easy to find. Wikipedia used to be wonderful. Increasingly, unfortunately, the information REAL Wikipedia users are likely to want is drowned out in the tedium of structure. I comment on this more at my Talk page. HTH. Jamesdowallen (talk) 09:38, 29 January 2019 (UTC)

Hope this is addressed with my last edit. Spitzak (talk) 18:12, 29 January 2019 (UTC)