Seemingly Calculation Error

I inserted circle and changed the number of sides as 8 to create an octogen. I entered the radius as 10 units. This octogen was at 0,0,0. Then I inserted a same octogen but radius of 8, But the centre was at 0,0,2

Then I joined both the octagons and entered edit mode. I divided the sides into half. I divided both the octagons.

Then I connected the midpoint fo sides of one octagon to another by an edge. Then measured the length. Theoretically, it shall be as follows

It should be equal to square root of 8 that is 2.83. But the measured value in blender is slightly different, The difference is around 8%

Where is the fault? In my modelling method or blender has some calculation error?Pyramid-Uday.blend (445 KB)

Your calculation is correct for the edge connecting the corners, not for the one connecting the middle points of the sides.