home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!morrow.stanford.edu!forsythe.stanford.edu!nova!maurer
- From: maurer@nova.stanford.edu (Michael Maurer)
- Newsgroups: comp.lang.c
- Subject: Re: the abs() function in C
- Date: 20 Nov 92 08:04:09 GMT
- Organization: STAR Lab, Stanford University, California USA
- Lines: 15
- Distribution: world
- Message-ID: <maurer.722246649@magellan.stanford.edu>
- References: <pebi.722223424@zephyr.aem.umn.edu>
- NNTP-Posting-Host: magellan.stanford.edu
-
- In <pebi.722223424@zephyr.aem.umn.edu> pebi@aem.umn.edu (Peter A. Bidian) writes:
-
-
- >Isn't abs(-2)=2 in C?
- >I always get 0.
-
- >Confused!
-
- >Peter
-
- you probably want to say abs(-2.0), if the abs() function expects a
- floating point argument. or abs((double)-2).
- --
- ______________________________________________________________________
- Michael Maurer maurer@nova.stanford.edu (415) 723-1024
-