Mercurial > flash_v2
comparison packages/language/c/libm/current/src/double/ieee754-api/w_asin.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_asin.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_asin.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 asin(x) | |
| 68 */ | |
| 69 | |
| 70 | |
| 71 #include "mathincl/fdlibm.h" | |
| 72 | |
| 73 | |
| 74 double asin(double x) /* wrapper asin */ | |
| 75 { | |
| 76 #ifdef CYGSEM_LIBM_COMPAT_IEEE_ONLY | |
| 77 return __ieee754_asin(x); | |
| 78 #else | |
| 79 double z; | |
| 80 z = __ieee754_asin(x); | |
| 81 if(cyg_libm_get_compat_mode() == CYGNUM_LIBM_COMPAT_IEEE || isnan(x)) return z; | |
| 82 if(fabs(x)>1.0) { | |
| 83 return __kernel_standard(x,x,2); /* asin(|x|>1) */ | |
| 84 } else | |
| 85 return z; | |
| 86 #endif | |
| 87 } | |
| 88 | |
| 89 #endif // ifdef CYGPKG_LIBM | |
| 90 | |
| 91 // EOF w_asin.c |
