Add floor function implementation and unit tests