mirror of
https://github.com/tstellar/bygfoot.git
synced 2024-12-15 09:54:52 +01:00
27 lines
534 B
C
27 lines
534 B
C
|
#ifndef MATH_H
|
||
|
#define MATH_H
|
||
|
|
||
|
#include <math.h>
|
||
|
#include "bygfoot.h"
|
||
|
#include "variables.h"
|
||
|
|
||
|
/**
|
||
|
Macros for random number generation (#rnd for float and #rndi for integer).
|
||
|
*/
|
||
|
#define rnd(lower,upper) ((gfloat)random()/(gfloat)0x7fffffff*((upper)-(lower))+(lower))
|
||
|
#define rndi(lower,upper) ((gint)rint( rnd((gfloat)(lower) - 0.499, (gfloat)(upper) + 0.499) ))
|
||
|
|
||
|
gfloat
|
||
|
gaussrand(void);
|
||
|
|
||
|
gfloat
|
||
|
gauss_dist(gfloat lower, gfloat upper);
|
||
|
|
||
|
gint
|
||
|
get_place(gint value, gint place);
|
||
|
|
||
|
gint
|
||
|
round_integer(gint number, gint places);
|
||
|
|
||
|
#endif
|