add ft_abs

This commit is contained in:
Tanguy MAZE
2018-05-05 16:52:49 +02:00
parent 0b57c88beb
commit 0ea4e74d77
6 changed files with 27 additions and 20 deletions

20
ft_abs.c Normal file
View File

@@ -0,0 +1,20 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_abs.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <tmaze@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/05/05 16:44:52 by tmaze #+# #+# */
/* Updated: 2018/05/05 16:49:04 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
unsigned int ft_abs(int nb)
{
if (nb < 0)
return (nb * -1);
return (nb);
}