GCC Code Coverage Report


Directory: ./
File: lib/my/my_printf/flag_bigf.c
Date: 2024-06-05 00:36:48
Exec Total Coverage
Lines: 14 14 100.0%
Functions: 2 2 100.0%
Branches: 4 4 100.0%

Line Branch Exec Source
1 /*
2 ** EPITECH PROJECT, 2023
3 ** my_printf
4 ** File description:
5 ** Flag to print a %F (a double)
6 */
7 /**
8 * @file flag_bigf.c
9 * @brief The file containing the flag_bigf function
10 * @author Nicolas TORO
11 */
12
13 #include "myprintf.h"
14
15 4 static char *my_get_str_float(double nb, formating_t *formating)
16 {
17 4 long long int partie_entiere = ABS((int)nb);
18
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
4 double partie_d = ABS(nb - partie_entiere);
19 4 char *str_finale = malloc(sizeof(char) * 1000000);
20
21 4 str_finale[0] = '\0';
22
2/2
✓ Branch 0 taken 3 times.
✓ Branch 1 taken 1 times.
4 if (nb < 0)
23 3 my_strcat(str_finale, "-");
24 4 my_strcat(str_finale, my_str_nbr_long_long(partie_entiere));
25 4 precise_it_double(str_finale, formating, partie_d);
26 4 format_it_double(str_finale, formating, partie_d);
27 4 return str_finale;
28 }
29
30 4 int flag_bigf(va_list list, formating_t *formating)
31 {
32 4 char *temp = my_get_str_float(va_arg(list, double), formating);
33
34 4 return my_putstr_fd_free(temp, formating->fd);
35 }
36