Re: 32sii: FLOOR function + 30b request Message #14 Posted by hugh steers on 20 Jan 2010, 3:30 p.m., in response to message #1 by Dave Britten
Yes indeed. can we have floor added to the 30b too!!
the usual offerings are IP and FP. IP (integer part) truncates to zero, so IP(-2.9) = -2, IP(-2.1) = -2, IP(2.1) = 2, IP(2) = 2, IP(-2) = -2.
fine, but also floor is useful, so in the above we have FLOOR(-2.9) = -3, FLOOR(-2.1) = -3, FLOOR(2.1) = 2, FLOOR(2) = 2,FLOOR(-2) = -2 etc.
this came up again because recently i needed ceil(x) (ceiling), which is conveniently defined by ceil(x) = -floor(-x).
so ceil and floor are not both needed, but it would be nice to have one of them and also the existing IP, otherwise a test and branch are required.
|