Compare commits
1 Commits
71806cb923
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ac98cb1f5 |
2
Makefile
2
Makefile
@@ -12,7 +12,7 @@ _DEP = libft.h
|
|||||||
DEPS = $(_DEP:%.h=$(IDIR)/%.h)
|
DEPS = $(_DEP:%.h=$(IDIR)/%.h)
|
||||||
|
|
||||||
CFLAGS = -I$(IDIR)
|
CFLAGS = -I$(IDIR)
|
||||||
CFLAGS += -Wall -Wextra -Werror -g3
|
CFLAGS += -Wall -Wextra -Werror -g
|
||||||
|
|
||||||
SRCS = ft_memset.c \
|
SRCS = ft_memset.c \
|
||||||
ft_bzero.c \
|
ft_bzero.c \
|
||||||
|
|||||||
@@ -18,11 +18,11 @@ double ft_sqrt(double x, double precision)
|
|||||||
{
|
{
|
||||||
prev_guess = guess;
|
prev_guess = guess;
|
||||||
guess = (guess + x / guess) / 2.0;
|
guess = (guess + x / guess) / 2.0;
|
||||||
} while (prev_guess - guess > precision);
|
} while (ft_fabs(prev_guess - guess) > precision);
|
||||||
return guess;
|
return guess;
|
||||||
|
|
||||||
// // binary search
|
// // binary search
|
||||||
// double low = 0
|
// double low = 0;
|
||||||
// double high = x;
|
// double high = x;
|
||||||
// double mid;
|
// double mid;
|
||||||
// while (high - low > precision)
|
// while (high - low > precision)
|
||||||
|
|||||||
Reference in New Issue
Block a user