Hi,

I get this error in the WebCL application “Animated M-set explorer” at

http://www.ibiblio.org/e-notes/webcl/webcl.htm

with kernel

[html]

#ifdef cl_khr_fp64

#pragma OPENCL EXTENSION cl_khr_fp64 : enable

#else

#pragma OPENCL EXTENSION cl_amd_fp64 : enable

#endif

__kernel void ckMandelbrot(__global uchar4* col, float scale){

ushort x = get_global_id(0), y = get_global_id(1);

```
double Cr = (x - 256) / scale + .37014983130958534;
double Ci = (y - 256) / scale + .10511722270082503;
double I=0, R=0, I2=0, R2=0;
ushort n=0;
while ( (R2+I2 < 4.) && (n < 1024) ){
I=(R+R)*I+Ci; R=R2-I2+Cr; R2=R*R; I2=I*I; n++;
}
if (n == 1024) col[y*512 + x] = (uchar4)(0, 0, 0, 255);
else{
short c = (short)((n % 64)*24.);
col[y*512 + x] = (uchar4)(
min( max( 0, abs(c - 768) - 384), 255 ),
min( max( 0, 512 - abs(c - 512)), 255 ),
min( max( 0, 512 - abs(c - 1024)), 255 ),
255);
}
```

}

[/html]

really it is just clamp(…, 0, 255). How can I correct my script?

Evgeny