home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16867 < prev    next >
Encoding:
Text File  |  1992-11-20  |  667 b   |  29 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!portal!dfuller
  3. From: dfuller@portal.hq.videocart.com (Dave Fuller)
  4. Subject: Re: the abs() function in C
  5. Message-ID: <By03nB.F2M@portal.hq.videocart.com>
  6. Organization: VideOcart Inc.
  7. X-Newsreader: Tin 1.1 PL3
  8. References: <pebi.722223424@zephyr.aem.umn.edu>
  9. Date: Fri, 20 Nov 1992 06:06:46 GMT
  10. Lines: 17
  11.  
  12. pebi@aem.umn.edu (Peter A. Bidian) writes:
  13. : Isn't abs(-2)=2 in C?
  14. : I always get 0.
  15. : Confused!
  16. : Peter
  17.  
  18. Correct. abs(-2) should return an integer value of 2. Maybe if some more
  19. code were made available, there is another reason you are seeing a 0
  20. for the value.
  21.  
  22. Dave Fuller
  23. dfuller@portal.hq.videocart.com
  24.  
  25.