ref: c44aabebe17d7bc8e6173e2b3d1a6e7b4f5edaf5
dir: /libkern/floor.c/
#include <lib9.h> /* * floor and ceil-- greatest integer <= arg * (resp least >=) */ double floor(double d) { double fract; if(d < 0) { fract = modf(-d, &d); if(fract != 0.0) d += 1; d = -d; } else modf(d, &d); return d; } double ceil(double d) { return -floor(-d); }