X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=device%2Flib%2Fsincosf.c;h=e4750e454bf184379bf133174ea7ae0cec29b488;hb=5050ca6a703fcf463627596ee9ac3cbaa06d610a;hp=f3788ba0b9e241fb41198d935ff4b1e18005395c;hpb=7fbf4dd6fc639f70eaa15e0765d91df904c7e9f7;p=fw%2Fsdcc diff --git a/device/lib/sincosf.c b/device/lib/sincosf.c index f3788ba0..e4750e45 100644 --- 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] - 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 #include +#include #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)*/