[cs23021] Sqrt()
Mikhail Nesterenko
mikhail at cs.kent.edu
Thu Sep 23 13:08:49 EDT 2010
sqrt() is most probably using so called Newton's method of finding the
roots of the equation. Here is the information in Wikipedia on the
method:
http://en.wikipedia.org/wiki/Newton%27s_method
The C code can be found here:
http://www.dreamincode.net/code/snippet244.htm
Note that as long as the roots are found correctly the implementation
of the function can be arbitrary.
Thanks,
--
Mikhail
> Yeah I was just wandering about the internals of the function. It would be
> cool to see
>
> -----Original Message-----
> From: Mikhail Nesterenko [mailto:mikhail at cs.kent.edu]
> Sent: Tuesday, September 21, 2010 10:22 PM
> Subject: Re: Sqrt()
>
> > Hi Professor.
> >
> >
> >
> > Is there a website to go to that shows the source code for pre-defined
> > functions such as sqrt()?
>
> Do you need the source code of the function definition (that is, descrition
> of what goes on inside the function) or example usage of sqrt? The example
> usage is in the examples on the course's webpage (all the examples that we
> go over in class are on the course's webpage). The internals of the
> functions like sqrt() are hard to find.
>
More information about the cs23021-2
mailing list