void test(int x, int y, int result) { int pc = ppcm(x, y); if (pc == result) { printf("PASSED\n"); } else { printf("FAILED: found %d instead of %d \n", pc, result); } }
/** * \details Compute the study interval * \return The study interval */ long Simulation::computeStudyInterval() { long current_ppcm = 1; for (deque<Task>::iterator it = _tasks.begin(); it != _tasks.end(); ++it) { current_ppcm = ppcm(current_ppcm, it->getPeriod()); } return (2*current_ppcm + maxOffsetOf(_tasks)); }