aboutsummaryrefslogtreecommitdiff
path: root/standard.h
blob: 6f56ebcbb7a483e38f2f138c0207734f8ae08005 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef standard_h
#define standard_h

int string_equal(const char* a, const char* b);

#define fbits 9

#define mini(a_, b_) ((a_) < (b_) ? (a_) : (b_))
#define maxi(a_, b_) ((a_) > (b_) ? (a_) : (b_))

int absolute(int x);
int fsin(int t);
int fcos(int t);
int ftan(int t);
int flerp(int a, int b, int t);
int fsqrt(int v);

void vec_nrmise(int* x, int* y);

void seed_rng(unsigned seed);
unsigned get_seed();
unsigned rng();
int rand_range(int a, int b);
int randf();

/* Not safe! */
int f_to_buf(int f, char* buf);
int int_to_buf(int n, char* buf);

#endif