Blame src/validation_tests/display_error.c

Packit 577717
#include <stdio.h>
Packit 577717
#include <stdlib.h>
Packit 577717
#include <unistd.h>
Packit 577717
Packit 577717
#include "display_error.h"
Packit 577717
Packit 577717
double display_error(long long average,
Packit 577717
		     long long high,
Packit 577717
		     long long low,
Packit 577717
		     long long expected,
Packit 577717
                     int quiet) {
Packit 577717
Packit 577717
   double error;
Packit 577717
Packit 577717
   error=(((double)average-expected)/expected)*100.0;
Packit 577717
Packit 577717
   if (!quiet) {
Packit 577717
      printf("   Expected: %lld\n", expected);
Packit 577717
      printf("   High: %lld   Low:  %lld   Average:  %lld\n",
Packit 577717
          high,low,average);
Packit 577717
Packit 577717
      printf("   ( note, a small value above %lld may be expected due\n",
Packit 577717
	  expected);
Packit 577717
      printf("     to overhead and interrupt noise, among other reasons)\n");
Packit 577717
Packit 577717
      printf("   Average Error = %.2f%%\n",error);
Packit 577717
   }
Packit 577717
Packit 577717
   return error;
Packit 577717
Packit 577717
}