/* 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
#include <math.h>
#include <errno.h>
+#include <stdbool.h>
#define r1 -0.1666665668E+0
#define r2 0.8333025139E-2
float sincosf(const float x, const int iscos)
{
float y, f, r, g, XN;
- int N, sign;
+ int N;
+ BOOL sign;
if(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)*/