PandA-2024.02
less.c
Go to the documentation of this file.
1 #include "aggregate.h"
2 
3 
4 int less (const void * a, const void * b, void * notUsed)
5 {
6  struct aggregate * aPtr = (struct aggregate *)a;
7  struct aggregate * bPtr = (struct aggregate *)b;
8 
9  float aSum = aPtr->a0 +
10  aPtr->a1 +
11  aPtr->a2 +
12  aPtr->a3 +
13  aPtr->a4 +
14  aPtr->a5 +
15  aPtr->a6 +
16  aPtr->a7;
17  float bSum = bPtr->a0 +
18  bPtr->a1 +
19  bPtr->a2 +
20  bPtr->a3 +
21  bPtr->a4 +
22  bPtr->a5 +
23  bPtr->a6 +
24  bPtr->a7;
25  int equal = (bSum - aSum) == 0;
26  if (equal) return 0;
27 
28  int lt = (aSum - bSum) < 0;
29  return lt ? -1 : 1;
30 }
31 
float a2
Definition: aggregate.h:8
float a3
Definition: aggregate.h:9
float a7
Definition: aggregate.h:13
float a5
Definition: aggregate.h:11
float a4
Definition: aggregate.h:10
float a6
Definition: aggregate.h:12
int less(const void *a, const void *b, void *notUsed)
Definition: less.c:4
float a1
Definition: aggregate.h:7
float a0
Definition: aggregate.h:6

Generated on Mon Feb 12 2024 13:02:47 for PandA-2024.02 by doxygen 1.8.13