Libft extra functions
This commit is contained in:
20
lib/libft/ft_iabs.c
Normal file
20
lib/libft/ft_iabs.c
Normal file
@@ -0,0 +1,20 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_iabs.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/11/16 20:22:27 by aortigos #+# #+# */
|
||||
/* Updated: 2025/11/16 20:22:46 by aortigos ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
int ft_iabs(int nb)
|
||||
{
|
||||
if (nb < 0)
|
||||
return (nb * -1);
|
||||
return (nb);
|
||||
}
|
||||
Reference in New Issue
Block a user