-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathft_abs.c
21 lines (19 loc) · 995 Bytes
/
ft_abs.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_abs.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ggane <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/04/20 19:18:38 by ggane #+# #+# */
/* Updated: 2016/04/20 19:29:49 by ggane ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_abs(int nb)
{
if (nb < 0)
return (nb = nb * -1);
else
return (nb);
}