diff options
Diffstat (limited to 'libft/src/ft_abs.c')
-rw-r--r-- | libft/src/ft_abs.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libft/src/ft_abs.c b/libft/src/ft_abs.c new file mode 100644 index 0000000..c732fee --- /dev/null +++ b/libft/src/ft_abs.c @@ -0,0 +1,16 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_abs.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +int ft_abs(int j) +{ + return ((j < 0) ? (-j) : (j)); +} |