Fix some random bugs in frexp that should have been caught when it was
authorChris Hanson <org/chris-hanson/cph>
Sat, 28 Oct 1989 11:00:32 +0000 (11:00 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 28 Oct 1989 11:00:32 +0000 (11:00 +0000)
written.

v7/src/microcode/missing.c

index d3cd7a9706499a61e6019b7c451c078a3575e803..19c6af4e462337ea77a73e1892748f9d2f736dcd 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/missing.c,v 9.25 1989/09/22 09:33:16 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/missing.c,v 9.26 1989/10/28 11:00:32 cph Rel $
 
 Copyright (c) 1987, 1988, 1989 Massachusetts Institute of Technology
 
@@ -45,7 +45,7 @@ frexp (value, eptr)
 {
   register double x = ((value < 0) ? (-value) : value);
   int e = 0;
-  if (x > 1)
+  if (x >= 1)
     {
       while (1)
        {
@@ -84,7 +84,7 @@ frexp (value, eptr)
            }
        }
     }
-  else if ((x > 0) && (x < 1))
+  else if (x > 0)
     {
       while (1)
        {
@@ -93,6 +93,7 @@ frexp (value, eptr)
              register double xr = (x * 4);
              register double r = 4;
              register int n = 1;
+             x *= 2;
              while (xr < 1)
                {
                  x = xr;