00001 /* 00002 * Copyright 2003, 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* 00006 00007 Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. 00008 00009 This program is free software; you can redistribute it and/or modify it 00010 under the terms of version 2.1 of the GNU Lesser General Public License 00011 as published by the Free Software Foundation. 00012 00013 This program is distributed in the hope that it would be useful, but 00014 WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 00017 Further, this software is distributed without any warranty that it is 00018 free of the rightful claim of any third person regarding infringement 00019 or the like. Any license provided herein, whether implied or 00020 otherwise, applies only to this software file. Patent licenses, if 00021 any, provided herein do not apply to combinations of this program with 00022 other software, or any other product whatsoever. 00023 00024 You should have received a copy of the GNU Lesser General Public 00025 License along with this program; if not, write the Free Software 00026 Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, 00027 USA. 00028 00029 Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, 00030 Mountain View, CA 94043, or: 00031 00032 http://www.sgi.com 00033 00034 For further information regarding this notice, see: 00035 00036 http://oss.sgi.com/projects/GenInfo/NoticeExplan 00037 00038 */ 00039 00040 00041 00042 /* ==================================================================== 00043 * ==================================================================== 00044 * 00045 * Module: cabs.c 00046 * $Revision: 1.5 $ 00047 * $Date: 04/12/21 14:58:20-08:00 $ 00048 * $Author: bos@eng-25.internal.keyresearch.com $ 00049 * $Source: /home/bos/bk/kpro64-pending/libm/SCCS/s.cabs.c $ 00050 * 00051 * Revision history: 00052 * 20-Jun-93 - Original Version 00053 * 00054 * Description: source code for cabs function 00055 * 00056 * ==================================================================== 00057 * ==================================================================== 00058 */ 00059 00060 static char *rcs_id = "$Source: /home/bos/bk/kpro64-pending/libm/SCCS/s.cabs.c $ $Revision: 1.5 $"; 00061 00062 #include "libm.h" 00063 00064 extern double __hypot(double, double); 00065 00066 struct __cabs_s { double r, i; }; 00067 00068 #if defined(mips) && !defined(__GNUC__) 00069 extern double cabs(struct __cabs_s); 00070 00071 #pragma weak cabs = __cabs 00072 #endif 00073 00074 #if defined(BUILD_OS_DARWIN) /* Mach-O doesn't support aliases */ 00075 #if 0 /* Builtin cabs had conflicting declaration */ 00076 extern double __cabs(struct __cabs_s z); 00077 #pragma weak cabs 00078 double cabs(struct __cabs_s z) { 00079 return __cabs(z); 00080 } 00081 #endif 00082 #elif defined(__GNUC__) 00083 extern double __cabs(struct __cabs_s); 00084 double cabs() __attribute__ ((weak, alias ("__cabs"))); 00085 #endif 00086 00087 double 00088 __cabs(z) 00089 struct __cabs_s z; 00090 { 00091 return __hypot(z.r, z.i); 00092 } 00093
1.5.6