Biorhythms: Difference between revisions

Content added Content deleted
Line 106: Line 106:


void cycle(long diff, int l, char *t) {
void cycle(long diff, int l, char *t) {
float p = 100 * sin(2 * M_PI * diff / l);
int p = round(100 * sin(2 * M_PI * diff / l));
printf("%12s cycle: %3.0f%%", t, round(p));
printf("%12s cycle: %3i%%", t, p);
if (abs(p) < 15)
if (abs(p) < 15)
printf(" (critical day)");
printf(" (critical day)");