Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!husc6!cmcl2!brl-adm!adm!DAVE%UWF.BITNET@wiscvm.wisc.EDU From: DAVE%UWF.BITNET@wiscvm.wisc.EDU Newsgroups: comp.lang.c Subject: Problems with PRINTF, for some ungodly reason... Message-ID: <7527@brl-adm.ARPA> Date: Mon, 25-May-87 14:49:28 EDT Article-I.D.: brl-adm.7527 Posted: Mon May 25 14:49:28 1987 Date-Received: Tue, 26-May-87 03:17:27 EDT Sender: news@brl-adm.ARPA Lines: 27 All, I've got a (hopefully) simple problem with the printf statement, using Lattice C V3. My code looks something like this: while (i <= N0) { p = (a + b) / b; printf("\ni = %5d, ",i); printf("p = %lf, so there", p); if (abs(p - pl) / abs(p) < tol) { printf("\n\nMethod Returns %lf after %d iterations.\n", p, i); return (0); } i++; pl = p; (f(a) * f(p) > 0) ? (a = p) : (b = p); } The problem is that both of the two printf's that try to output the variable 'P' meet with disaster, in that both output the format spec, in this case, the %lf, but I also tried %f, %g, and %G, mostly in desperation. How does one output a (double) variable? Lost & 1/2, Dave Jaquay (DAVE@UWF.BITNET)