diff options
Diffstat (limited to 'nuttx/lib/math/lib_cos.c')
-rw-r--r-- | nuttx/lib/math/lib_cos.c | 43 |
1 files changed, 29 insertions, 14 deletions
diff --git a/nuttx/lib/math/lib_cos.c b/nuttx/lib/math/lib_cos.c index f8732b041..09808bd9f 100644 --- a/nuttx/lib/math/lib_cos.c +++ b/nuttx/lib/math/lib_cos.c @@ -1,5 +1,15 @@ -/* - * Copyright (C) 2009, 2010 Nick Johnson <nickbjohnson4224 at gmail.com> +/************************************************************************ + * lib/math/lib_cos.c + * + * This file is a part of NuttX: + * + * Copyright (C) 2012 Gregory Nutt. All rights reserved. + * Ported by: Darcy Gong + * + * It derives from the Rhombs OS math library by Nick Johnson which has + * a compatibile, MIT-style license: + * + * Copyright (C) 2009-2011 Nick Johnson <nickbjohnson4224 at gmail.com> * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -12,20 +22,25 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ + * + ************************************************************************/ -#include <stdint.h> -#include <float.h> -#include <apps/math.h> +/************************************************************************ + * Included Files + ************************************************************************/ -float cosf(float x) { - return sinf(x + M_PI_2); -} +#include <nuttx/config.h> +#include <nuttx/compiler.h> -double cos(double x) { - return sin(x + M_PI_2); -} +#include <math.h> + +/************************************************************************ + * Public Functions + ************************************************************************/ -long double cosl(long double x) { - return sinl(x + M_PI_2); +#if CONFIG_HAVE_DOUBLE +double cos(double x) +{ + return sin(x + M_PI_2); } +#endif |