added finished algorithm
merged algorithm from other personnal repo
This commit is contained in:
20
libft/srcs/ft_abs.c
Normal file
20
libft/srcs/ft_abs.c
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user