Skip to content

Commit

Permalink
Avoid product into a potentially very big number
Browse files Browse the repository at this point in the history
Susceptible to overflow on platforms with 4-bytes size_t.
  • Loading branch information
xrobin committed Mar 2, 2014
1 parent 2191d47 commit e71e57b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/delong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List delongPlacementsCpp(List roc) {
Y[j] /= xsize;
}
List ret;
ret["theta"] = sum / (xsize * ysize);
ret["theta"] = sum / xsize / ysize;
ret["X"] = X;
ret["Y"] = Y;
return(ret);
Expand Down

0 comments on commit e71e57b

Please sign in to comment.