Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: Homework & the net (was Roots of polynomials) Message-ID: <4470@goanna.cs.rmit.oz.au> Date: 10 Dec 90 06:45:37 GMT References: <2173@mentor.cc.purdue.edu> <1990Dec5.175558.29859@dg-rtp.dg.com> <49248@seismo.CSS.GOV> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 30 I'd like to (a) give the original poster some help, and (b) offer a slightly different point of view. (a) Get a copy of the book "Numerical Recipes" (the Fortran and Pascal version) or the C version "Numerical Recipes in C". If you have a use for complex roots of polynomials, you have a use for this book. Look at the subroutines ZROOTS and QROOT. *Read* *the* *entire* *chapter*. (b) I spent enough time this year telling my students that when they start to work as programmers it will be better to ask for help than to deliver incorrect or irrelevant code to the customer that I don't like to see people who ask for help stepped on. When it's a case of something really obvious that anyone using C _must_ have access to, then "RTFM" is appropriate. I was rather annoyed by the person who said "I can't find XXXX in the SunOS manuals" when a few minutes of probing with "man" gets you there. But I don't think it hurts to mention _which_ manual in an RTFM flame. Did it occur to anyone that the poster's _real_ question may have been "how do I do complex arithmetic in C"? The C and Pascal versions of the Numerical Recipes code have some rather subtle code to implement complex division and square root. I wonder how many readers of this newsgroup could code up complex division so that it never overflows or underflows when it doesn't have to? Fortran still has its uses (as does f2c). -- The Marxists have merely _interpreted_ Marxism in various ways; the point, however, is to _change_ it. -- R. Hochhuth.