https://www.johndcook.com/blog/2021/04/15/floor-ceiling-bracket/ John D. Cook Skip to content * MATH + PROBABILITY + NUMERICAL ANALYSIS + SIGNAL PROCESSING + SEE ALL ... * STATS + EXPERT TESTIMONY + RANDOMIZATION + CLINICAL TRIALS + SEE ALL ... * PRIVACY + HIPAA + CCPA + DIFFERENTIAL PRIVACY * WRITING + BLOG + TWITTER + ARTICLES + NEWSLETTER + TECH NOTES + SUBSCRIBE * ABOUT + CLIENTS + ENDORSEMENTS + TEAM + SERVICES (832) 422-8646 Contact Floor, ceiling, bracket Posted on 15 April 2021 by John Mathematics notation changes slowly over time, generally for the better. I can't think of an instance that I think was a step backward. Gauss introduced the notation [x] for the greatest integer less than or equal to x in 1808. The notation was standard until relatively recently, though some authors used the same notation to mean the integer part of x. The two definitions agree if x is positive, but not if x is negative. Not only is there an ambiguity between the two meanings of [x], it's not immediately obvious that there is an ambiguity since we naturally think first of positive numbers. This leads to latent errors, such as software that works fine until the first person gives something a negative input. In 1962 Kenneth Iverson introduced the notation [?]x[?] ("floor of x") and [?]x[?] ("ceiling of x") in his book A Programming Language, the book that introduced APL. According to Concrete Mathematics, Iverson found that typesetters could handle the symbols by shaving off the tops and bottoms of '[' and ']'. This slight modification of the existing notation made things much clearer. The notation [x] is not mnemonic, but clearly [?]x[?] means to move down and [?]x[?] means to move up. Before Iverson introduced his ceiling function, there wasn't a standard notation for the smallest integer greater than or equal to x . If you did need to refer to what we now call the ceiling function, it was awkward to do so. And if there was a symmetry in some operation between rounding down and rounding up, the symmetry was obscured by asymmetric notation. My impression is that [?]x[?] became more common than [x] somewhere around 1990, maybe earlier in computer science and later in mathematics. Iverson and APL Iverson's introduction of the floor and ceiling functions was brilliant. The notation is mnemonic, and it filled what in retrospect was a gaping hole. In hindsight, it's obvious that if you have a notation for what we now call floor, you should also have a notation for what we now call ceiling. Iverson also introduced the indicator function notation, putting a Boolean expression in brackets to denote the function that is 1 when the expression is true and 0 when the expression is false. Like his floor and ceiling notation, the indicator function notation is brilliant. I give an example of this notation in action here. I had a small consulting project once where my main contribution was to introduce indicator function notation. That simple change in notation made it clear how to untangle a complicated calculation. Since two of Iverson's notations were so simple and useful, might there be more? He introduced a lot of new notations in his programming language APL, and so it makes sense to mine APL for more notations that might be useful. But at least in my experience, that hasn't paid off. I've tried to read Iverson's lecture Notation as a Tool of Thought several times, and every time I've given up in frustration. Judging by which notations have been widely adopted, the consensus seems to be that the floor, ceiling, and indicator function notations were the only ones worth stealing from APL. Categories : Math Tags : notation Bookmark the permalink Post navigation Previous PostBox in ball in box in high dimension 5 thoughts on "Floor, ceiling, bracket" 1. Michael P 15 April 2021 at 09:38 There is a slight ambiguity in "the smallest integer": At first, I read that as meaning smallest-magnitude (truncate towards zero), but the usual convention for the floor function is least-positive (truncate towards minus infinity). One might generalize the square-bracket notation by affixing negative infinity, zero, or positive infinity to the brackets, indicating truncation to the nearest integer in the direction of that value. Similar notations for rounding, rather than truncation, could follow. I don't know that anyone does that, though. 2. Ned Batchelder 15 April 2021 at 11:12 I attended a talk by Iverson once, and he explained that one of the advantages of APL was that it was readable. I guess it's a subjective thing.... :) 3. Ashley Yakeley 15 April 2021 at 11:20 And now you can write the most beautiful equation in mathematics, [?]e[?] = [?]p[?]. (I don't remember where I heard this one.) 4. Martin Janiczek 15 April 2021 at 11:50 There is some APL legacy living on in function naming, if not in the notation/symbols. I'm talking about `iota` for range generation (IIRC Go and C++ have that) and `reduce` (many functional programming languages have that). 5. Ken 15 April 2021 at 17:05 Feynman once wrote about having invented new symbols for trigonometric functions. He wasn't happy with seeing the letters "s i n" smashed together, as if they were variables to be multiplied. IIRC, his symbols had a long tail over the top (like square roots), and at the left side it turned into the shape of the letter "S"/"C"/"T". I don't remember what the inverses or hyperbolics were. I can't point to any specific case where notation made a step backwards, but it certainly has made many steps to the side. Notation often seems to change for no apparent reason other than fashion. Newton's notation isn't any worse than Lagrange's, IMHO, but I haven't seen it used in any books in the past 50 years. Fortunately, calculus is still not lacking for redundant notations. And of course physicists make up their own notation just for fun all the time. Which probably explains Feynman! Leave a Reply Cancel reply Your email address will not be published. Required fields are marked * [ ] [ ] [ ] [ ] [ ] [ ] [ ] Comment [ ] Name * [ ] Email * [ ] Website [ ] [Post Comment] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] Search for: [ ] [Search] John D. Cook John D. Cook, PhD, President My colleagues and I have decades of consulting experience helping companies solve complex problems involving data privacy, math, statistics, and computing. Let's talk. We look forward to exploring the opportunity to help your company too. [ ] [ ] [ ] [ ] [ ] [Send] John D. Cook (c) All rights reserved. Search for: [ ] [Search] (832) 422-8646 EMAIL