Move common floor() code into floorImpl()
Convert isNan/isInfinite into generic functions, add compile-time float path