Files
42_INT_01_libft/srcs/ft_abs.c
2026-05-10 20:18:37 +02:00

13 lines
156 B
C

#include "libft.h"
/**
* returns the absolute value of an int number
*/
int ft_abs(int n)
{
if (n <= 0)
n *= -1; // also works for -0
return (n);
}