fix compilation error and fix stddev calculation

This commit is contained in:
2025-05-02 23:57:11 +02:00
parent e3a2901370
commit b96652f9a4
3 changed files with 8 additions and 8 deletions

View File

@ -6,7 +6,7 @@
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/05/01 17:41:42 by tomoron #+# #+# */
/* Updated: 2025/05/02 01:03:15 by tomoron ### ########.fr */
/* Updated: 2025/05/02 23:53:28 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -18,15 +18,13 @@ void update_stats(t_stats *stats, double time)
stats->received++;
tmp = 0;
if(stats->prev)
tmp = time - stats->avg;
tmp = time - stats->avg;
stats->min = MIN(stats->min, time);
if(stats->min == 0)
stats->min = time;
stats->max = MAX(stats->max, time);
stats->avg += (time - stats->avg) / stats->received;
if(stats->prev)
stats->sqr_diff += tmp * stats->avg;
stats->sqr_diff += tmp * stats->avg;
stats->prev = time;
}