feat(math/abs): adding ft_abs function

- Return the absolute value
This commit is contained in:
Raphael 2025-09-17 16:41:56 +02:00
parent 2be64a8f1b
commit 6879b46aee
No known key found for this signature in database

21
math/ft_abs.c Normal file
View file

@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* 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);
}