HP Forums
CEILING function substitute for 35s - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: CEILING function substitute for 35s (/thread-124570.html)



CEILING function substitute for 35s - Martin Pinckney - 09-11-2007

Does anyone know a set of functions that combined, will return the same result as the CEILING function (38G)?

Will be used on the 35s.

Thanks for any ideas.


Re: CEILING function substitute for 35s - Meenzer - 09-11-2007

For the FLOOR function: left shift-INTG-4


For the CEIL function: do the above and add 1

Edited: 11 Sept 2007, 3:36 p.m.


Re: CEILING function substitute for 35s - Eduardo Duenez - 09-11-2007

Not really so! CEIL(x) is *equal* to FLOOR(x) if x is an integer!

I don't have a 35s yet but CEIL(x) = -FLOOR(-x), so a solution is to write a short program executing

NEG FLOOR NEG

Eduardo


Re: CEILING function substitute for 35s - Paul Dale - 09-11-2007

Quote:
For the CEIL function: do the above and add 1

Which would be wrong when the argument is an exact integer.

- Pauli


Re: CEILING function substitute for 35s - Meenzer - 09-12-2007

Of course, the more enlightened posters above me are right!

But with that neat NEG FLOOR NEG trick everything is provided for...;-)