Skip to content

Commit

Permalink
Avoid divide by zero
Browse files Browse the repository at this point in the history
Updates #723
  • Loading branch information
shawnlaffan committed Apr 6, 2019
1 parent 6d85bdb commit d3f08a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Biodiverse/BaseData.pm
Expand Up @@ -411,7 +411,7 @@ sub clone_with_coarser_cell_sizes {

my $current_o = $current_cell_origins->[$i];
my $new_o = $new_cell_origins->[$i];
$fmod = ($current_o ne $new_o)
$fmod = ($current and $current_o ne $new_o)
? fmod (abs ($new_o - $current_o) / $current, 1)
: 0;
croak "new origin for axis $i of $new_o does not conform "
Expand Down

0 comments on commit d3f08a9

Please sign in to comment.