update .rt et norme
This commit is contained in:
@@ -6,12 +6,22 @@
|
||||
/* By: yantoine <yantoine@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/02/17 21:19:17 by yantoine #+# #+# */
|
||||
/* Updated: 2025/02/17 21:20:13 by yantoine ### ########.fr */
|
||||
/* Updated: 2025/02/18 17:14:00 by yantoine ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "miniRT.h"
|
||||
|
||||
inline static char *check_sign(char *str, int *sign)
|
||||
{
|
||||
if (*str == '-')
|
||||
{
|
||||
*sign = -1;
|
||||
str++;
|
||||
}
|
||||
return (str);
|
||||
}
|
||||
|
||||
float ft_atof(char *str)
|
||||
{
|
||||
float res;
|
||||
@@ -21,11 +31,7 @@ float ft_atof(char *str)
|
||||
res = 0;
|
||||
dec = 0;
|
||||
sign = 1;
|
||||
if (*str == '-')
|
||||
{
|
||||
sign = -1;
|
||||
str++;
|
||||
}
|
||||
str = check_sign(str, &sign);
|
||||
while (*str >= '0' && *str <= '9')
|
||||
{
|
||||
res = res * 10 + *str - '0';
|
||||
|
||||
Reference in New Issue
Block a user