// pmsqrt v0.1a. // // This program is licensed under the GNU GPL 2.0 license. Refer to gnu.org for more information. // // pmsqrt (v0.1a) calculates square roots using a blind, brute force method. No table lookups, // no guesswork, no memory manipulation and absolutely zero loops. // // This version perfectly calculates ALL perfect squares. However, it roughly approximates // irrational squares. That will change in the next version. Have fun :) #include #include int main() { int N; float a,d, MachRoot; printf("Enter Square: "); scanf("%d", &N); MachRoot = (ceil((floor(a = (N/2/(d = (floor((N/8)+4)/2)))))+(d/2)));//+((N-(a*a))*(1/(a*2+1))); printf("%f is a, %f is answer", a, MachRoot); return 0; }