mandelbrot/mandelbrot.cpp
2022-07-04 19:22:36 +02:00

19 lines
322 B
C++

#include "mandelbrot.h"
#include "utils.h"
uint32_t mandelbrot(const BigFloat &c, Vec2bf &ret)
{
uint32_t iter = 0;
const uint32_t max_iter = 100;
BigFloat z = BigFloat(c.precision);
z.setValue(0.0);
while(z <= 2 || iter < max_iter)
{
z = z*z+c;
iter++;
}
return iter;
}