diff options
Diffstat (limited to 'ft_abs.c')
| -rw-r--r-- | ft_abs.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ft_abs.c b/ft_abs.c new file mode 100644 index 0000000..14492cd --- /dev/null +++ b/ft_abs.c @@ -0,0 +1,18 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_abs.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/04 03:31:16 by cacharle #+# #+# */ +/* Updated: 2020/02/04 03:32:54 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libft.h" + +int ft_abs(int i) +{ + return (i < 0 ? -i : i); +} |
