From f662d7f750d555e4be10c3e01399e20bf8cc758b Mon Sep 17 00:00:00 2001 From: hugogogo Date: Tue, 12 May 2026 00:35:11 +0200 Subject: [PATCH] removed unused and wrong ft_modf --- Makefile | 1 - includes/libft.h | 1 - srcs/ft_modf.c | 25 ------------------------- 3 files changed, 27 deletions(-) delete mode 100644 srcs/ft_modf.c diff --git a/Makefile b/Makefile index 5b52b42..c1b7e81 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,6 @@ SRCS = ft_memset.c \ ft_smaller.c \ ft_sign.c \ ft_fsign.c \ - ft_modf.c \ ft_pow.c \ ft_sqrt.c \ ft_round.c \ diff --git a/includes/libft.h b/includes/libft.h index 59b3573..829f8e2 100644 --- a/includes/libft.h +++ b/includes/libft.h @@ -130,7 +130,6 @@ int ft_greater(int a, int b); int ft_smaller(int a, int b); int ft_sign(int i); int ft_fsign(double i); -double ft_modf(double x, double *int_part); double ft_pow(double base, int exponent); double ft_round(double x); double ft_sqrt(double i); diff --git a/srcs/ft_modf.c b/srcs/ft_modf.c deleted file mode 100644 index 277a3c1..0000000 --- a/srcs/ft_modf.c +++ /dev/null @@ -1,25 +0,0 @@ -#include "libft.h" - -#include // tmp for printf, for float debug - -/** - * Splits a double into its integer and fractional parts, - * it returns the fractional part, - * and stores the integer part in the in_part param (if not null) - * e.g.: - * -3.7 → -3.0 and -0.7 (returns -0.7) - */ -double ft_modf(double x, double *store_int_part) -{ - // extract the integer part by casting to long long - long long integer = (long long)x; - if (store_int_part != NULL) - { - *store_int_part = (double)integer; - } - - // compute the fractional part - double frac_part = x - integer; - - return frac_part; -}