The article here says:
Dividing x, y, and z by w accomplishes this. The resulting coordinates are called normalized device coordinates. Now all the visible geometric data lies in a cube with positions between <-1, -1, -1> and <1, 1, 1> in OpenGL, and between <-1, -1, 0> and <1, 1, 1> in Direct3D.
This raises a problem for cross-platform shaders which want to test the Z coordinate for some specific reason. Is there a way to get a Z coord in the same range, regardless of platform?