Print this page
5261 libm should stop using synonyms.h
5298 fabs is 0-sized, confuses dis(1) and others
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Approved by: Gordon Ross <gwr@nexenta.com>


   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23  */
  24 /*
  25  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29 #pragma weak cabs = __cabs
  30 
  31 #include "libm_synonyms.h"
  32 #include <math.h>
  33 #include "complex_wrapper.h"
  34 
  35 /*
  36  * If C were the only standard we cared about, cabs could just call
  37  * hypot.  Unfortunately, various other standards say that hypot must
  38  * call matherr and/or set errno to ERANGE when the result overflows.
  39  * Since cabs should do neither of these things, we have to either
  40  * make hypot a wrapper on another internal function or duplicate
  41  * the hypot implementation here.  I've chosen to do the latter.
  42  */
  43 
  44 static const double
  45         zero = 0.0,
  46         onep1u = 1.00000000000000022204e+00,    /* 0x3ff00000 1 = 1+2**-52 */
  47         twom53 = 1.11022302462515654042e-16,    /* 0x3ca00000 0 = 2**-53 */
  48         twom768 = 6.441148769597133308e-232,    /* 2^-768 */
  49         two768  = 1.552518092300708935e+231;    /* 2^768 */
  50 
  51 double




   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
  23  */
  24 /*
  25  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  26  * Use is subject to license terms.
  27  */
  28 
  29 #pragma weak __cabs = cabs
  30 

  31 #include <math.h>
  32 #include "complex_wrapper.h"
  33 
  34 /*
  35  * If C were the only standard we cared about, cabs could just call
  36  * hypot.  Unfortunately, various other standards say that hypot must
  37  * call matherr and/or set errno to ERANGE when the result overflows.
  38  * Since cabs should do neither of these things, we have to either
  39  * make hypot a wrapper on another internal function or duplicate
  40  * the hypot implementation here.  I've chosen to do the latter.
  41  */
  42 
  43 static const double
  44         zero = 0.0,
  45         onep1u = 1.00000000000000022204e+00,    /* 0x3ff00000 1 = 1+2**-52 */
  46         twom53 = 1.11022302462515654042e-16,    /* 0x3ca00000 0 = 2**-53 */
  47         twom768 = 6.441148769597133308e-232,    /* 2^-768 */
  48         two768  = 1.552518092300708935e+231;    /* 2^768 */
  49 
  50 double