projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* device/include/pic16/adc.h,
[fw/sdcc]
/
device
/
lib
/
sincosf.c
diff --git
a/device/lib/sincosf.c
b/device/lib/sincosf.c
index f3788ba0b9e241fb41198d935ff4b1e18005395c..e4750e454bf184379bf133174ea7ae0cec29b488 100644
(file)
--- a/
device/lib/sincosf.c
+++ b/
device/lib/sincosf.c
@@
-1,6
+1,6
@@
/* sincosf.c: Computes sin or cos of a 32-bit float as outlined in [1]
/* sincosf.c: Computes sin or cos of a 32-bit float as outlined in [1]
- Copyright (C) 2001, 2002 Jesus Calvino-Fraga, jesusc@ieee.org
+ Copyright (C) 2001, 2002 Jesus Calvino-Fraga, jesusc@ieee.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@
-23,6
+23,7
@@
#include <math.h>
#include <errno.h>
#include <math.h>
#include <errno.h>
+#include <stdbool.h>
#define r1 -0.1666665668E+0
#define r2 0.8333025139E-2
#define r1 -0.1666665668E+0
#define r2 0.8333025139E-2
@@
-40,11
+41,7
@@
float sincosf(const float x, const int iscos)
{
float y, f, r, g, XN;
int N;
{
float y, f, r, g, XN;
int N;
-#ifdef SDCC_mcs51
- bit sign;
-#else
- char sign;
-#endif
+ BOOL sign;
if(iscos)
{
if(iscos)
{
@@
-69,7
+66,7
@@
float sincosf(const float x, const int iscos)
N=((y*iPI)+0.5); /*y is positive*/
/*If N is odd change sign*/
N=((y*iPI)+0.5); /*y is positive*/
/*If N is odd change sign*/
- if(N&1) sign=
~
sign;
+ if(N&1) sign=
!
sign;
XN=N;
/*Cosine required? (is done here to keep accuracy)*/
XN=N;
/*Cosine required? (is done here to keep accuracy)*/