home *** CD-ROM | disk | FTP | other *** search
- /*------------------------------------------------------------------------
- * filename - fabs.cas
- *
- * function(s)
- * fabs - absolute value
- *-----------------------------------------------------------------------*/
-
- /*[]------------------------------------------------------------[]*/
- /*| |*/
- /*| Turbo C Run Time Library - Version 3.0 |*/
- /*| |*/
- /*| |*/
- /*| Copyright (c) 1987, 1990 by Borland International |*/
- /*| All Rights Reserved. |*/
- /*| |*/
- /*[]------------------------------------------------------------[]*/
-
-
- #pragma inline
- #include <asmrules.h>
-
- #include <_math.h>
- #include <math.h>
-
-
- /*--------------------------------------------------------------------------*
-
- Name fabs - absolute value
-
- Usage double fabs(double x);
-
- Prototype in math.h
-
- Description fabs calculates the absolute value of x, which may have any
- value.
-
- Return value fabs returns the absolute value of x.
-
- *---------------------------------------------------------------------------*/
- double fabs (double x)
- {
- asm FWAIT
- asm and BY0 (x [7]), 7Fh /* remove any sign bit */
- return x;
- }
-