Initial commit

This commit is contained in:
2026-01-09 15:20:33 +01:00
commit d0a9d550e5
31 changed files with 2248 additions and 0 deletions

28
srcs/utils/ft_sqrt.c Normal file
View File

@@ -0,0 +1,28 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_sqrt.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lejulien <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/08/12 13:38:59 by lejulien #+# #+# */
/* Updated: 2021/03/29 17:40:39 by lejulien ### ########.fr */
/* */
/* ************************************************************************** */
float ft_sqrt(float n)
{
float x;
float y;
float e;
x = n;
y = 1;
e = 0.00001;
while (x - y > e)
{
x = (x + y) / 2;
y = n / x;
}
return (x);
}