comparison packages/language/c/libm/current/src/double/ieee754-api/w_atan2.c @ 0:3111d98ba7b3 ecos-v1_1-release

Initial commit of eCos version 1.1
author jlarmour
date Tue, 11 May 1999 11:16:07 +0000
parents
children 443894e2e912
comparison
equal deleted inserted replaced
-1:000000000000 0:3111d98ba7b3
1 //===========================================================================
2 //
3 // w_atan2.c
4 //
5 // Part of the standard mathematical function library
6 //
7 //===========================================================================
8 //####COPYRIGHTBEGIN####
9 //
10 // -------------------------------------------
11 // The contents of this file are subject to the Cygnus eCos Public License
12 // Version 1.0 (the "License"); you may not use this file except in
13 // compliance with the License. You may obtain a copy of the License at
14 // http://sourceware.cygnus.com/ecos
15 //
16 // Software distributed under the License is distributed on an "AS IS"
17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
18 // License for the specific language governing rights and limitations under
19 // the License.
20 //
21 // The Original Code is eCos - Embedded Cygnus Operating System, released
22 // September 30, 1998.
23 //
24 // The Initial Developer of the Original Code is Cygnus. Portions created
25 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved.
26 // -------------------------------------------
27 //
28 //####COPYRIGHTEND####
29 //===========================================================================
30 //#####DESCRIPTIONBEGIN####
31 //
32 // Author(s): jlarmour@cygnus.co.uk
33 // Contributors: jlarmour@cygnus.co.uk
34 // Date: 1998-02-13
35 // Purpose:
36 // Description:
37 // Usage:
38 //
39 //####DESCRIPTIONEND####
40 //
41 //===========================================================================
42
43 // CONFIGURATION
44
45 #include <pkgconf/libm.h> // Configuration header
46
47 // Include the Math library?
48 #ifdef CYGPKG_LIBM
49
50 // Derived from code with the following copyright
51
52
53 /* @(#)w_atan2.c 1.3 95/01/18 */
54 /*
55 * ====================================================
56 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
57 *
58 * Developed at SunSoft, a Sun Microsystems, Inc. business.
59 * Permission to use, copy, modify, and distribute this
60 * software is freely granted, provided that this notice
61 * is preserved.
62 * ====================================================
63 *
64 */
65
66 /*
67 * wrapper atan2(y,x)
68 */
69
70 #include "mathincl/fdlibm.h"
71
72
73 double atan2(double y, double x) /* wrapper atan2 */
74 {
75 #ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY
76 return __ieee754_atan2(y,x);
77 #else
78 double z;
79 z = __ieee754_atan2(y,x);
80 if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE||isnan(x)||isnan(y)) return z;
81 if(x==0.0&&y==0.0) {
82 return __kernel_standard(y,x,3); /* atan2(+-0,+-0) */
83 } else
84 return z;
85 #endif
86 }
87
88 #endif // ifdef CYGPKG_LIBM
89
90 // EOF w_atan2.c