-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_positive.c
More file actions
executable file
·25 lines (23 loc) · 1.07 KB
/
ft_positive.c
File metadata and controls
executable file
·25 lines (23 loc) · 1.07 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_positive.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: luperez <luperez@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/12/03 04:11:31 by luperez #+# #+# */
/* Updated: 2014/12/03 04:33:37 by luperez ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_positive(int n)
{
if (n == -2147483648)
{
ft_putstrerrno("I can't make positive the -2147483648 value in int");
exit(2);
}
if (n < 0)
return (-1 * n);
return (n);
}