Getting real depth value

Another strange question by me :slight_smile:
Is there a way to get the real distance from camera to a point in the rendered scene (like the values that are shown in Image Editor window after rendering when you click and hold LMB and wave the cursor around the image)?
I need info about the farthest point visible in the scene - not the coordinates, but the depth value, so I can set the camera clipping distances.