. pci driver now returns devices, even when they have been pci_reserve()d
[minix3.git] / lib / float / cmf4.c
blobee186ff4c1b3b7ba115c8a659abbaad2e30e4318
1 /*
2 (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 See the copyright notice in the ACK home directory, in the file "Copyright".
4 */
6 /* $Header$ */
8 /*
9 COMPARE SINGLES (CMF 4)
12 #include "FP_types.h"
13 #include "get_put.h"
15 int
16 cmf4(f1,f2)
17 SINGLE f1,f2;
20 * return ((f1 < f2) ? 1 : (f1 - f2))
22 #define SIGN(x) (((x) < 0) ? -1 : 1)
23 int sign1,sign2;
24 long l1,l2;
26 l1 = get4((char *) &f1);
27 l2 = get4((char *) &f2);
29 if (l1 == l2) return 0;
31 sign1 = SIGN(l1);
32 sign2 = SIGN(l2);
33 if (sign1 != sign2) {
34 if ((l1 & 0x7fffffff) == 0 &&
35 (l2 & 0x7fffffff) == 0) return 0;
36 return ((sign1 > 0) ? -1 : 1);
39 return (sign1 * ((l1 < l2) ? 1 : -1));