only change sign when value is not 0
authorceriel <none@none>
Wed, 29 Jun 1988 16:34:40 +0000 (16:34 +0000)
committerceriel <none@none>
Wed, 29 Jun 1988 16:34:40 +0000 (16:34 +0000)
mach/proto/fp/ngf4.c
mach/proto/fp/ngf8.c

index 7b2351f..540b1f1 100644 (file)
@@ -21,7 +21,9 @@ _float        f;
 {
        char unsigned   *p;
 
-       p = (char unsigned *) &f;
-       *p ^= 0x80;
+       if (f != (_float) 0) {
+               p = (char unsigned *) &f;
+               *p ^= 0x80;
+       }
 }
 
index 178a9b7..b36a53c 100644 (file)
@@ -21,7 +21,9 @@ _double       f;
 {
        unsigned char   *p;
 
-       p = (unsigned char *) &f;
-       *p ^= 0x80;
+       if (f[0] != 0 || f[1] != 0) {
+               p = (unsigned char *) &f;
+               *p ^= 0x80;
+       }
 }