blob: c6d6aa3b47d33aa0c7bac585d4fcc37f49f4a7ab (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
typedef struct
{
long i;
double f;
} T;
f (T *n1, T *n2)
{
if (g (n2))
return n1->i - n2->i;
else
{
double f = n1->f - n2->i;
return f == 0.0 ? 0 : (f > 0.0 ? 1 : -1);
}
}
|