MOM6
bitcount.c File Reference
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
Include dependency graph for bitcount.c:

Go to the source code of this file.

Functions

int bitcount_ (double *x)
 
int bitcount (double *x)
 

Function Documentation

◆ bitcount()

int bitcount ( double *  x)

Definition at line 22 of file bitcount.c.

References bitcount_().

23 {
24  return bitcount_(x);
25 }
int bitcount_(double *x)
Definition: bitcount.c:7
Here is the call graph for this function:

◆ bitcount_()

int bitcount_ ( double *  x)

Definition at line 7 of file bitcount.c.

Referenced by bitcount().

8 {
9 int b;
10 unsigned long *y;
11 double z;
12 
13 z = *x;
14 y = (unsigned long *) &z;
15 for (b = 0; *y !=0; *y >>= 1)
16  if (*y & 01)
17  b++;
18 return b;
19 }
Here is the caller graph for this function: