#include #include #include "util.h" double absD(double x){ if(x<0){ return -1 * x; } return x; } double squashDegreesTo360(double degrees){ int multiple = degrees / 360; return degrees - (360*multiple); } unsigned long long fac(int x){ unsigned long long prod = 1; if(x==0) return 1; for (int i = 1; i <= x; i++){ if (prod > ULLONG_MAX / i){ break; } prod*=i; } return prod; }