float fSqrt(float fValue){ //Find the Square root of a number using Babylonian Square Root Method, and return the floating point value double dNumberAvgLast; double dNumberDivided; double dNumberAvg; float sqrRoot; //Shortened return value dNumberAvg = fValue; //We need an initial value - why not make it the value we are trying to find the square root of, hey? do { dNumberAvgLast = dNumberAvg; //Right, reassign current average value to being last average value dNumberDivided = fValue/dNumberAvgLast; //Now figure out the divisor value and square root dNumberAvg = (dNumberAvgLast + dNumberDivided)/2; } while (dNumberAvgLast > dNumberAvg); sqrRoot = dNumberAvgLast; //Return shortened value (float accuracy, not double) return sqrRoot;}