You cannot expect the square root of a length (given in mm) to be of dimension length. That would mean you would expect length times length to be of dimension length instead of area. Thus your equation might be designed for dimension- or unit-free values, how they are sometimes still in use. They require you to put in the data in certain units and deliver the result also in certain units. If you use such equations with variables containing value and unit, you first must divide the input by the required input unit and take the result times the expected results units. I'd try to avoid this, because this procedure is far from self documenting. Try to use equations involving just real physical quantities regardless of their units. SMath is ideally suited to handle such equations.
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx