diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-02-04 03:39:35 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-02-04 03:39:35 +0100 |
| commit | 435fec311c0c5173ae99c32b8f4e6431bd1e43d2 (patch) | |
| tree | cdcfe1672c8343c41c59087a9ff23500f32cfca8 /ft_abs.c | |
| parent | f4e1232957b1270da70f57fcad4cd6371947e442 (diff) | |
| download | libft-435fec311c0c5173ae99c32b8f4e6431bd1e43d2.tar.gz libft-435fec311c0c5173ae99c32b8f4e6431bd1e43d2.tar.bz2 libft-435fec311c0c5173ae99c32b8f4e6431bd1e43d2.zip | |
Added ft_abs
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); +} |
