The known value of THD for a pure rectangular switching function, for which the duty ratio D = 0.5, is 0.483 or 48.3%. I have tried to back-calculate this using formulae for THD in order to work out the THD for a switching function assuming the dc component has been removed by filtering.
Considering the RMS value is
I got the following:
Upon plugging the duty ratio value of 0.5 into D, my result is 40.507, whereas it should come out to 0.483. I'm positive that I'm not plugging it into the calculator wrong, and that the equations are correct. Why is it not coming out to 0.483?

