-
Notifications
You must be signed in to change notification settings - Fork 0
/
math_42.h
executable file
·69 lines (52 loc) · 2.45 KB
/
math_42.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* math_42.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akharrou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/12 11:09:19 by akharrou #+# #+# */
/* Updated: 2019/05/26 10:09:24 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef MATH_42_H
# define MATH_42_H
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
# define E 2.71828182845U
# define PI 3.14159265359U
# define GOLDEN_RATIO 1.61803398875U
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
# define ISODD(n) (n % 2 == 1)
# define ISEVEN(n) (n % 2 == 0)
# define ABS(x) ((x < 0) ? (-x) : (x))
# define MAX(x, y) ((x > y) ? (x) : (y))
# define MIN(x, y) ((x < y) ? (x) : (y))
# define CEIL(x) (((float)x > (int)x) ? ((int)x + 1) : (x))
# define FLOOR(x) ((int)x)
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
double ft_sqrt(double x);
double ft_pow(double x, double y);
long double ft_powl(long double x, long double y);
unsigned long long ft_powll(long x, int y);
int ft_sum(int *vector, unsigned int size);
long ft_sum_l(long *vector, unsigned int size);
double ft_sum_d(double *vector, unsigned int size);
long double ft_sum_ld(long double *vector, unsigned int size);
long double ft_max(int *vector);
long ft_max_l(long *vector, unsigned int size);
double ft_max_d(double *vector, unsigned int size);
long double ft_min(int *vector);
long ft_min_l(long *vector, unsigned int size);
double ft_min_d(double *vector, unsigned int size);
long double ft_round(long double n);
long double ft_round_with_prior(long double n);
/*
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
*/
#endif