I wrote:
http://lo-res.org/~x/nolink/ceilfloor.tar.gz - use the power of -lm of your os of choice.
and the python version (needs the python external, and the script in your path): http://lo-res.org/~x/nolink/cfpy.tar.gz
ok I'll stop now, I just love to be distracted from doing actual work
regards,
x