d_sign.c 266 B

123456789101112131415161718
  1. #include "f2c.h"
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. #ifdef KR_headers
  6. double d_sign(a,b) doublereal *a, *b;
  7. #else
  8. double d_sign(doublereal *a, doublereal *b)
  9. #endif
  10. {
  11. double x;
  12. x = (*a >= 0 ? *a : - *a);
  13. return( *b >= 0 ? x : -x);
  14. }
  15. #ifdef __cplusplus
  16. }
  17. #endif