do store in global to force convert to float despite C bug.
authorJerry Berkman <jerry@ucbvax.Berkeley.EDU>
Wed, 10 Jul 1985 06:34:06 +0000 (22:34 -0800)
committerJerry Berkman <jerry@ucbvax.Berkeley.EDU>
Wed, 10 Jul 1985 06:34:06 +0000 (22:34 -0800)
SCCS-vsn: usr.bin/f77/libF77/pow_ri.c 5.2
SCCS-vsn: usr.bin/f77/libF77/r_dim.c 5.3
SCCS-vsn: usr.bin/f77/libF77/r_mod.c 5.3
SCCS-vsn: usr.bin/f77/libF77/r_nint.c 5.3

usr/src/usr.bin/f77/libF77/pow_ri.c
usr/src/usr.bin/f77/libF77/r_dim.c
usr/src/usr.bin/f77/libF77/r_mod.c
usr/src/usr.bin/f77/libF77/r_nint.c

index 312f674..fc16638 100644 (file)
@@ -3,9 +3,11 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)pow_ri.c    5.1     %G%
+ *     @(#)pow_ri.c    5.2     %G%
  */
 
  */
 
+float flt_retval;
+
 float pow_ri(ap, bp)
 float *ap;
 long int *bp;
 float pow_ri(ap, bp)
 float *ap;
 long int *bp;
@@ -23,7 +25,8 @@ if(n != 0)
                {
                if(x == 0)
                        {
                {
                if(x == 0)
                        {
-                       return(pow);
+                       flt_retval = pow;
+                       return(flt_retval);
                        }
                n = -n;
                x = 1/x;
                        }
                n = -n;
                x = 1/x;
@@ -38,5 +41,6 @@ if(n != 0)
                        break;
                }
        }
                        break;
                }
        }
-return(pow);
+flt_retval = pow;
+return(flt_retval);
 }
 }
index 07ed810..580c945 100644 (file)
@@ -3,11 +3,14 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)r_dim.c     5.2     %G%
+ *     @(#)r_dim.c     5.3     %G%
  */
 
  */
 
+float flt_retval;
+
 float r_dim(a,b)
 float *a, *b;
 {
 float r_dim(a,b)
 float *a, *b;
 {
-return( *a > *b ? *a - *b : 0);
+flt_retval =  *a > *b ? *a - *b : 0;
+return(flt_retval);
 }
 }
index 7d5036b..125cd21 100644 (file)
@@ -3,9 +3,11 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)r_mod.c     5.2     %G%
+ *     @(#)r_mod.c     5.3     %G%
  */
 
  */
 
+float flt_retval;
+
 float r_mod(x,y)
 float *x, *y;
 {
 float r_mod(x,y)
 float *x, *y;
 {
@@ -14,5 +16,6 @@ if (quotient >= 0.0)
        quotient = floor(quotient);
 else
        quotient = -floor(-quotient);
        quotient = floor(quotient);
 else
        quotient = -floor(-quotient);
-return(*x - (*y) * quotient );
+flt_retval = *x - (*y) * quotient ;
+return(flt_retval);
 }
 }
index a22e41f..27f7c9f 100644 (file)
@@ -3,14 +3,16 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)r_nint.c    5.2     %G%
+ *     @(#)r_nint.c    5.3     %G%
  */
 
  */
 
+float flt_retval;
+
 float r_nint(x)
 float *x;
 {
 double floor();
 
 float r_nint(x)
 float *x;
 {
 double floor();
 
-return( (*x)>=0 ?
-       floor(*x + .5) : -floor(.5 - *x) );
+flt_retval = (*x)>=0 ? floor(*x + .5) : -floor(.5 - *x);
+return(flt_retval);
 }
 }