Compare commits
2 Commits
e95f55c07f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ac98cb1f5 | ||
|
|
71806cb923 |
2
Makefile
2
Makefile
@@ -12,7 +12,7 @@ _DEP = libft.h
|
||||
DEPS = $(_DEP:%.h=$(IDIR)/%.h)
|
||||
|
||||
CFLAGS = -I$(IDIR)
|
||||
CFLAGS += -Wall -Wextra -Werror -g3
|
||||
CFLAGS += -Wall -Wextra -Werror -g
|
||||
|
||||
SRCS = ft_memset.c \
|
||||
ft_bzero.c \
|
||||
|
||||
@@ -32,8 +32,10 @@ long long ft_atoll_superscript(const char *str)
|
||||
int digit;
|
||||
if (superscript_size == 2)
|
||||
{
|
||||
// ² (U+00B2) or ³ (U+00B3)
|
||||
if ((uint8_t)str[i + 1] == 0xB2)
|
||||
// ¹ (U+00B9), ² (U+00B2), or ³ (U+00B3)
|
||||
if ((uint8_t)str[i + 1] == 0xB9)
|
||||
digit = 1;
|
||||
else if ((uint8_t)str[i + 1] == 0xB2)
|
||||
digit = 2;
|
||||
else if ((uint8_t)str[i + 1] == 0xB3)
|
||||
digit = 3;
|
||||
|
||||
@@ -18,11 +18,11 @@ double ft_sqrt(double x, double precision)
|
||||
{
|
||||
prev_guess = guess;
|
||||
guess = (guess + x / guess) / 2.0;
|
||||
} while (prev_guess - guess > precision);
|
||||
} while (ft_fabs(prev_guess - guess) > precision);
|
||||
return guess;
|
||||
|
||||
// // binary search
|
||||
// double low = 0
|
||||
// double low = 0;
|
||||
// double high = x;
|
||||
// double mid;
|
||||
// while (high - low > precision)
|
||||
|
||||
Reference in New Issue
Block a user