libft/math/ft_abs.c
Raphael 6879b46aee
feat(math/abs): adding ft_abs function
- Return the absolute value
2025-09-17 16:41:56 +02:00

21 lines
1,007 B
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_abs.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/09/17 16:37:35 by rparodi #+# #+# */
/* Updated: 2025/09/17 16:39:43 by rparodi ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdint.h>
uint32_t ft_abs(int64_t value)
{
if (value < 0)
return (-value);
else
return (value);
}