Fixes #791.

As per the description in #791, d == distance_normalization in some
cases, which produces a bad access in the octants/quadrants vector.

By using the floor function, we guarantee that the result will fall
between 0 and 12 inclusive, but never reach 13. The subtraction by an
integer makes the static_cast unnecessary.
Merge pull request #792 from mohawkjohn/issue_791

Fixes #791 (bad access in the quadrants vector)