From 2d75e800a1cd3dff630ec0080a864ef1779496c9 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 28 Sep 2020 18:57:09 +0200 Subject: New libft funcs --- libft/src/ft_abs.c | 16 ++++++++++++++++ libft/src/ft_labs.c | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 libft/src/ft_abs.c create mode 100644 libft/src/ft_labs.c (limited to 'libft/src') 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 +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* 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 +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* 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)); +} -- cgit v1.2.3