Closed Thread
Page 2 of 2 FirstFirst 12
Results 11 to 11 of 11

Thread: Help with Square root and calculator program!!!

  1. #11
    jbakid is offline Newbie
    Join Date
    Dec 2007
    Posts
    6
    Rep Power
    0

    Here ya are

    float sq_root(float n){
    float ret = 1.0;
    float tmp = 0.0;
    threshold = 1.0e-7;
    while(1){
    tmp = ret;
    ret = (ret+(n/ret))/2;
    if((tmp-ret)<threshold)
    return ret;
    }
    }
    Last edited by jbakid; 12-02-2007 at 02:36 PM. Reason: fmat & accuracy

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
Closed Thread
Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Need help with Square Root function
    By Gz1987 in forum C and C++
    Replies: 4
    Last Post: 12-08-2009, 01:46 AM
  2. Square root or multiplication
    By echoBravo in forum General Programming
    Replies: 7
    Last Post: 11-25-2009, 08:43 AM
  3. calculate Square root of a number PROBLEM
    By Esi_Gold in forum C and C++
    Replies: 8
    Last Post: 05-06-2008, 04:53 AM
  4. finding square root and prime numbers.?
    By aladin in forum General Programming
    Replies: 1
    Last Post: 11-07-2007, 05:49 PM
  5. Roulette / Square root C program help!!!
    By madaznfootballer in forum C and C++
    Replies: 4
    Last Post: 11-07-2007, 05:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts