gilbert icon indicating copy to clipboard operation
gilbert copied to clipboard

C implementation returns 0, 0 as an index for larger dimensions.

Open OetkenPurveyorOfCode opened this issue 9 months ago • 0 comments

I think it is because of this line. line 187 in gilbert.c

if (max_iter > 100000) { return -1; }

When this line is removed, the gilbert_d2xy appears to wrok fine with larger width and height. Otherwise it returns 0. As an example gilbert_d2xy(&x, &y, 7861, 490, 490) sets x and y incorrectly to zero and returns -1. Can you explain why you set a maxiter value in the c implementation, when it works fine beyond that? (I know it is correct to guard against things like overflow, but dimensions like 490x490 are not that large and uncommon and overflow still does not seem to happen at these still relatively small width and height values)

OetkenPurveyorOfCode avatar May 05 '24 21:05 OetkenPurveyorOfCode