How to interpret output position values of Geometry node
You're turning a vector into a float. So float=(v[0]+v[1]+v[2])/3.

this will give the correct result:

shader Inspector(float xcomp=0, float ycomp=0, float zcomp=0, output color debug=0)
{
  debug = (xcomp+ycomp+zcomp)/3;
  printf("\n");
  printf("%f,%f,%f &gt;&gt; %f" , xcomp, ycomp, zcomp, debug);
}


Use the SeparateXYZ and connect each components to the script.