diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-28 18:57:09 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-28 18:57:09 +0200 |
commit | 2d75e800a1cd3dff630ec0080a864ef1779496c9 (patch) | |
tree | fa1ffe1d148a0cb731d8622c635963dd450fd084 /libft/src | |
parent | TODO.org update (diff) | |
download | 42-minishell-2d75e800a1cd3dff630ec0080a864ef1779496c9.tar.gz 42-minishell-2d75e800a1cd3dff630ec0080a864ef1779496c9.tar.bz2 42-minishell-2d75e800a1cd3dff630ec0080a864ef1779496c9.tar.xz 42-minishell-2d75e800a1cd3dff630ec0080a864ef1779496c9.tar.zst 42-minishell-2d75e800a1cd3dff630ec0080a864ef1779496c9.zip |
New libft funcs
Diffstat (limited to 'libft/src')
-rw-r--r-- | libft/src/ft_abs.c | 16 | ||||
-rw-r--r-- | libft/src/ft_labs.c | 16 |
2 files changed, 32 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)); +} diff --git a/libft/src/ft_labs.c b/libft/src/ft_labs.c new file mode 100644 index 0000000..980c005 --- /dev/null +++ b/libft/src/ft_labs.c @@ -0,0 +1,16 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_labs.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 */ +/* */ +/* ************************************************************************** */ + +long ft_labs(long j) +{ + return ((j < 0) ? (-j) : (j)); +} |