Skip to content
Snippets Groups Projects
Commit 28f52659 authored by Miguel Espino's avatar Miguel Espino
Browse files

first implementation of doubleComp.c

parent aa63b930
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
* @date: July 2023
*/
#include <qsort.h>
/* returns -1 if first < second
* returns 0 if first == second
......@@ -11,7 +12,16 @@
*/
int compareDouble(void *first, void *second)
{
/* fill in the details of comparing 2 doubles */
double dFirst, dSecond;
dFirst = *(double*)first;
dSecond = *(double*)second;
if(first < second){
return -1;
}
return (first > second);
/* fill in the details of comparing 2 doubles */
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment