Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!seismo!rochester!pt.cs.cmu.edu!sei.cmu.edu!firth From: firth@sei.cmu.edu.UUCP Newsgroups: comp.lang.c Subject: Re: C and Floating Point Message-ID: <901@aw.sei.cmu.edu.sei.cmu.edu> Date: Wed, 8-Apr-87 16:37:08 EST Article-I.D.: aw.901 Posted: Wed Apr 8 16:37:08 1987 Date-Received: Sat, 18-Apr-87 03:09:50 EST References: <15958@sun.uucp> <5716@brl-smoke.ARPA> <14681@cca.CCA.COM> <1163@drivax.UUCP> <14813@cca.CCA.COM> Sender: netnews@sei.cmu.edu Reply-To: firth@bd.sei.cmu.edu.UUCP (PUT YOUR NAME HERE) Organization: Carnegie-Mellon University, SEI, Pgh, Pa Lines: 18 Keywords: C Fortran Floating Point In article <14813@cca.CCA.COM> g-rh@CCA.UUCP (Richard Harter) writes: (brief excerpt) >... Given that we have arranged things so that convergence >is forced, i.e. so that are guaranteed to reach a point such that, >for some n, > > x[n+1] = x[n] + delta[n] = x[n], > >what is the proper way to test for this, if the calculations are >being done in floating point? I would suggest abs(delta[n]/x[n]) <= eps (omit the abs if feasible). This gives the compiler least chance to screw you. If you have some way to relate 'eps' to the machine precision, even better.