* as/link/lkar.h: sgetl and sputl are independent of endianness
[fw/sdcc] / device / lib / sincosf.c
index f3788ba0b9e241fb41198d935ff4b1e18005395c..e4750e454bf184379bf133174ea7ae0cec29b488 100644 (file)
@@ -1,6 +1,6 @@
 /*  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
@@ -23,6 +23,7 @@
 
 #include <math.h>
 #include <errno.h>
+#include <stdbool.h>
 
 #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;
-#ifdef SDCC_mcs51
-       bit sign;
-#else
-       char sign;
-#endif
+       BOOL sign;
 
     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*/
-    if(N&1) sign=~sign;
+    if(N&1) sign=!sign;
 
     XN=N;
     /*Cosine required? (is done here to keep accuracy)*/