-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_abs.c
23 lines (20 loc) · 1.03 KB
/
ft_abs.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_abs.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jraymond <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/02/07 14:15:58 by jraymond #+# #+# */
/* Updated: 2018/02/14 17:24:26 by jraymond ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_abs(int nb)
{
return (nb = (nb < 0) ? -nb : nb);
}
long long ft_llabs(long long nb)
{
return (nb = (nb < 0) ? -nb : nb);
}