cgul_common.h File Reference

common macros More...

#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <locale.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
Include dependency graph for cgul_common.h:
This graph shows which files directly or indirectly include this file:

Macros

#define CGUL_VERSION   "1.8.0"
 
#define CGUL_EXPORT
 
#define CGUL_BEGIN_C
 
#define CGUL_END_C
 
#define CGUL_MIN(x, y)   (((x) < (y)) ? (x) : (y))
 
#define CGUL_MAX(x, y)   (((x) < (y)) ? (y) : (x))
 
#define CGUL_BITS_TO_BYTES(nbits)   (((nbits) + (CHAR_BIT - 1)) / CHAR_BIT)
 
#define CGUL_INVERSE_2_32   ((double)2.3283064365386963e-10)
 

Detailed Description

Common macros.

Author
Paul Serice

Macro Definition Documentation

§ CGUL_VERSION

#define CGUL_VERSION   "1.8.0"

The cgul version.

§ CGUL_EXPORT

#define CGUL_EXPORT

The import/export tag for Windows.

§ CGUL_BEGIN_C

#define CGUL_BEGIN_C

§ CGUL_END_C

#define CGUL_END_C

§ CGUL_MIN

#define CGUL_MIN (   x,
 
)    (((x) < (y)) ? (x) : (y))

Return the minimum of x and y.

§ CGUL_MAX

#define CGUL_MAX (   x,
 
)    (((x) < (y)) ? (y) : (x))

Return the maximum of x and y.

§ CGUL_BITS_TO_BYTES

#define CGUL_BITS_TO_BYTES (   nbits)    (((nbits) + (CHAR_BIT - 1)) / CHAR_BIT)

This macro will return the number of bytes needed to store "nbits".

§ CGUL_INVERSE_2_32

#define CGUL_INVERSE_2_32   ((double)2.3283064365386963e-10)

Precomputed value of 1/2^32 as a double. This is used by PRNGs when return values on the range [0, 1).