-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutils_2.c
34 lines (30 loc) · 1.24 KB
/
utils_2.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils_2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jaesjeon <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/02 15:59:58 by jaemjeon #+# #+# */
/* Updated: 2022/11/03 11:59:59 by jaesjeon ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
void set_range_int(int *to_set, int floor, int ceil)
{
if (*to_set < floor)
*to_set = floor;
else if (*to_set > ceil)
*to_set = ceil;
}
void set_range_double(double *to_set, double floor, double ceil)
{
if (*to_set < floor)
*to_set = floor;
else if (*to_set > ceil)
*to_set = ceil;
}
int exit_game(int exit_status)
{
exit(exit_status);
}