Mandelbrot- What am I doning wrong?

BlitzMax Forums/BlitzMax Programming/Mandelbrot- What am I doning wrong?

I know what it is! The DotCol function is returning an int it should return a float

Function DotCol:Float(xval:Float,yval:Float)
Local r:Float
Local i:Float
Local j:Float
Local m:Float

While (j < maxval) And (m < 4.0)
j = j + 1.0
m = (r * r) - (i * i)
i = ((2.0 * r) * i) + yval
r = m + xval
Wend

j = j / maxval
Return j
EndFunction