Jump to content

Talk:Floor and ceiling functions: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Line 170: Line 170:


::::I agree: drop the entire "in words" sentence. [https://en.wikipedia.org/w/index.php?title=Floor_and_ceiling_functions&diff=1027807188&oldid=1026534063 This edit] seemed to correct the verbal explanation, but it was still difficult to follow. I think the simple definition is intuitively obvious and needs no further explanation. — [[User:Anita5192|Anita5192]] ([[User talk:Anita5192|talk]]) 17:17, 10 June 2021 (UTC)
::::I agree: drop the entire "in words" sentence. [https://en.wikipedia.org/w/index.php?title=Floor_and_ceiling_functions&diff=1027807188&oldid=1026534063 This edit] seemed to correct the verbal explanation, but it was still difficult to follow. I think the simple definition is intuitively obvious and needs no further explanation. — [[User:Anita5192|Anita5192]] ([[User talk:Anita5192|talk]]) 17:17, 10 June 2021 (UTC)

::::{{Done}} — [[User:Anita5192|Anita5192]] ([[User talk:Anita5192|talk]]) 17:21, 10 June 2021 (UTC)


== Different definition of integer part in different countries ==
== Different definition of integer part in different countries ==

Revision as of 17:21, 10 June 2021

Template:Vital article

WikiProject iconComputer science B‑class Mid‑importance
WikiProject iconThis 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.
BThis article has been rated as B-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-importance on the project's importance scale.
Things you can help WikiProject Computer science with:

WikiProject iconMathematics B‑class Mid‑priority
WikiProject iconThis 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.
BThis article has been rated as B-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-priority on the project's priority scale.

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

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

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

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

Please better representation

See better ceil(x) at https://www.maplesoft.com/support/help/content/1939/image84.png as better "filled color" (red in this case). The line is also filled, like a bolded line. The addiction of the "empty point" representation of the line function needs to be bold.

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

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)[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]
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)[reply]
Looks good to me. --JBL (talk) 19:09, 8 June 2018 (UTC)[reply]

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

See wp:UNSOURCED and wp:NOR. See also wp:CALC and wp:CONSENSUS. - DVdm (talk) 11:43, 6 January 2019 (UTC)[reply]
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)[reply]
And, of course, wp:BURDEN. - DVdm (talk) 12:14, 6 January 2019 (UTC)[reply]
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)[reply]
@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)[reply]
@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)[reply]
@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)[reply]

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

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

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

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

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

Hope this is addressed with my last edit.

Spitzak (talk) 18:12, 29 January 2019 (UTC)[reply]

Relation to directional rounding to integer

"Not quite rounding. See Floor and ceiling functions#Rounding."

Can someone please explain this? From what I can tell, rounding up to the nearest integer should be equivalent to ceiling, and similarly for rounding down equaling floor. The section referenced and the definitions of floor and ceiling are all incredibly technical and thus useless to anyone that has not gotten a degree in mathematics. --Bastian 51234 (talk) 23:27, 8 December 2019 (UTC)[reply]

Rounding is to the nearest integer—not necessarily to the nearest greater integer or nearest least integer. For example,
1.4 rounded is 1,
the floor of 1.4 is 1,
the ceiling of 1.4 is 2.
1.6 rounded is 2,
the floor of 1.6 is 1,
the ceiling of 1.6 is 2.
So the floor of a fraction is always down; the ceiling of a fraction is always up; rounding can be up or down depending upon whether the fraction is less than one half. —Anita5192 (talk) 00:09, 9 December 2019 (UTC)[reply]
I think I agree with Bastian 51234 on two points here: first, that the current first description is bizarrely technical, and second, that the floor and ceiling functions are particular rounding functions. In particular, there are lots of rounding rules (see Rounding), and these two functions correspond to the rounding rules "round down" and "round up". It would be good if the first sentence were less technical, and mentioning rounding somewhere in the lead would also be reasonable. --JBL (talk) 02:54, 10 December 2019 (UTC)[reply]
I also agree, in lay use the term "round down" and "round up" are equivalent floor and ceiling for positive numbers. Perhaps they are technically incorrect by using the word "round" but not returning the closest integer, but the terms are certainly used this way right or wrong.Spitzak (talk) 20:25, 10 December 2019 (UTC)[reply]
If a word/phrase is used to mean a certain thing, it takes that definition no matter the original meaning(see the words "awful" and "awesome" for example). On top of this, without the common definitions of the terms "round up" and "round down", the terms are,to my knowledge, meaningless in math. Because of these two things, I feel adding them would increase the average person's understanding without degrading the expert's understanding, especially if the clarification that this would be a simplified version of the definition. Bastian 51234 (talk) 05:54, 11 December 2019 (UTC)[reply]

Real numbers or floating point numbers?

These functions are usually used with floating point numbers, an approximation of the real number system that has some important differences. Using them with real numbers gives some results that may be unexpected: floor(0.99999...) = 1 because 0.9 repeating is equal to 1. floor( max(0,1) ) = 0 using the range notation for all numbers between 0 and 1 exclusive.

Also, Reference 1 cites this wikipedia page. It is a circular reference. Subcelestial (talk) 14:33, 4 November 2020 (UTC)[reply]

"These functions are usually used with floating point numbers" -- not true, they are also used in mathematics.
"floor(0.99999...) = 1 because 0.9 repeating is equal to 1." -- this is a fact about the rounding of 0.999..., not about the floor function; if floor(0.999...) returns 1, it means that the argument was actually 1.0.
"floor( max(0,1) ) = 0 using the range notation for all numbers between 0 and 1 exclusive." -- max(0,1) is not a standard notation for "all number between 0 and 1 exclusive".
So I don't think any changes are called for. --Macrakis (talk) 16:29, 4 November 2020 (UTC)[reply]
(edit conflict) I have removed this reference, and two others per WP:ELNO. Such web citing may be acceptable when there no reliably published references, but this is not the case here.
These functions are defined for real numbers, not only for floating point numbers, which all are rational numbers. Using approximations for computing may always lead to wrong results. For example, using floating-point, (3. * (2.^10 * (1. / 3.))) / 2.^10 does not normally results into 1 (some clever compilers may produce 1., by rearranging the order of operations). Here the floor function is specific because it is not continuous, which means that one cannot get a good approximation of the correct result by increasing the accuracy (size of the mantissa). D.Lazard (talk) 16:58, 4 November 2020 (UTC)[reply]

Integral part

In the recent edits, it is asserted that, as Legendre used "partie entière inférieure", the function that he denoted was the floor function. This is not convincing, because, I belive that he was interested only in positive values of x. So, it must be checked in Legendre's work whether he defined his function for negative x, and if he did, which was his definition. D.Lazard (talk) 20:43, 4 November 2020 (UTC)[reply]

I agree that this seems dubious without a very good citation, but I also think it was removed again (perhaps, by me)? --JBL (talk) 21:51, 4 November 2020 (UTC)[reply]
I saw that in a StackOverflow question when searching for whether [x] means floor or round-toward-zero, but no reliabla reference. I agree it is possible this is in error, and in fact [x] does not define the behavior for negative numbers. That would at least make it not conflict with the use of [x] for round-toward-zero which is used in the opening section (but I cannot find any references showing that use is common).Spitzak (talk) 22:24, 4 November 2020 (UTC)[reply]
@DVdm:The section currently reads:
"In words, this is the integer that has the largest absolute value less than or equal to the absolute value of x."
I agree with the IP who previously edited this, that it is ambiguous. For example, if x = –3.9, then |x| = 3.9, the largest integer less than or equal to |x| is 3, and the integer that has the largest absolute value less than or equal to the absolute value of x could be –3 or 3. — Anita5192 (talk) 15:33, 10 June 2021 (UTC)[reply]
I agree that the current wording is problematic, but I haven't come up with a concise alternative that is clearer. Maybe just drop the "in words" part? --Macrakis (talk) 16:47, 10 June 2021 (UTC)[reply]
I agree: drop the entire "in words" sentence. This edit seemed to correct the verbal explanation, but it was still difficult to follow. I think the simple definition is intuitively obvious and needs no further explanation. — Anita5192 (talk) 17:17, 10 June 2021 (UTC)[reply]
 DoneAnita5192 (talk) 17:21, 10 June 2021 (UTC)[reply]

Different definition of integer part in different countries

I think it would be useful to say somewhere that the definition of "integer part" given in the introduction is only valid in some countries. In France for example, this is equal to the floor function : see the french page "partie entière" of wikipedia.

This maybe answers the previous question ? --89.95.99.135 (talk) 18:33, 27 January 2021 (UTC)[reply]