r_sign.c 248 B

123456789101112131415161718
  1. #include "f2c.h"
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. #ifdef KR_headers
  6. double r_sign(a,b) real *a, *b;
  7. #else
  8. double r_sign(real *a, real *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