home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20021 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.5 KB

  1. Path: sparky!uunet!math.fu-berlin.de!news.th-darmstadt.de!rbg.informatik.th-darmstadt.de!misar
  2. From: misar@rbg.informatik.th-darmstadt.de (Walter Misar)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Unknown library call info wanted.
  5. Date: 21 Jan 1993 17:38:18 GMT
  6. Organization: TH Darmstadt
  7. Lines: 33
  8. Distribution: world
  9. Message-ID: <1jmn2aINNipd@rs2.hrz.th-darmstadt.de>
  10. References: <1993Jan19.164340.3547@frog.CRDS.COM>
  11. NNTP-Posting-Host: rbhp61.rbg.informatik.th-darmstadt.de
  12.  
  13. In article <1993Jan19.164340.3547@frog.CRDS.COM>, miket@frog.CRDS.COM (Michael C Tiernan) writes:
  14. >     This seems to be the most appropriate place for this so here
  15. >     goes.
  16. >     I've got a piece of PD code which is fine EXCEPT for one library
  17. >     call:
  18. >         "dist = copysign(d2 / argp->intervals, argp->distg)"
  19. >     Does anyone out there know what 'copysign' does specifically?
  20. >     I can assume what it does but I'd like to get a really specific
  21. >     description maybe in the form of a manual page from some system
  22. >     so I can write a substitute for it.
  23.  
  24. I found it in a manpage on a sun4:
  25. > #include <math.h>
  26. ....
  27. > double copysign(x,y)
  28. > double x, y;
  29. ....
  30. > copysign(x,y) returns x with y's sign bit.
  31.  
  32. double copysign(double x, double y)
  33. { if (y>=0) return fabs(x);
  34.   else return -fabs(x);
  35. }
  36.  
  37. should do as a replacemant.
  38.  
  39. -- 
  40. Walter Misar                                | It is impossible to enjoy
  41. misar@rbg.informatik.th-darmstadt.de        | idling thoroughly unless
  42.                                             | one has plenty of work to do.
  43.