Skip to content

Commit

Permalink
docs: set sign to double
Browse files Browse the repository at this point in the history
  • Loading branch information
gunjjoshi committed Aug 3, 2024
1 parent 98e1cda commit d8832e1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,25 +548,25 @@ static double rational_p6q6( const double x ) {
* // returns ~1.202
*/
static double series( const double s ) {
uint8_t sign;
double sign;
double term;
double sum;
double tmp;
int32_t N2;
int32_t i;

sum = 0.0;
sign = 1;
sign = 1.0;
for ( i = 0; i < N; i++ ) {
sum += sign * NEG_TWO_N / stdlib_base_pow( (double)( i + 1 ), s );
sign *= -1; // flip the sign
sign *= -1.0; // flip the sign
}
tmp = 1.0;
term = 1.0;
N2 = 2 * N;
for ( i = N; i <= N2 - 1; i++ ) {
sum += sign * ( tmp - TWO_N ) / stdlib_base_pow( (double)( i + 1 ), s );
sign *= -1; // flip the sign
sign *= -1.0; // flip the sign
term *= N2 - i;
term /= i - N + 1.0;
tmp += term;
Expand Down

0 comments on commit d8832e1

Please sign in to comment.