6 lines
112 B
C
6 lines
112 B
C
#include <math.h>
|
|
|
|
double minimum_image(double dx, double box) {
|
|
return dx - box * floor(dx / box + 0.5);
|
|
}
|