Skip to content

Commit

Permalink
fix boxsize=0.
Browse files Browse the repository at this point in the history
  • Loading branch information
rainwoodman committed Jan 9, 2017
1 parent caaa093 commit 707cc2b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scipy/spatial/ckdtree/src/distance.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ struct BoxDist1D {
static inline const npy_float64
wrap_position(const npy_float64 x, const npy_float64 boxsize)
{
if (boxsize <= 0) return x;
const npy_float64 r = std::floor(x / boxsize);
return x - r * boxsize;
}
Expand Down

0 comments on commit 707cc2b

Please sign in to comment.