Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!ejk From: ejk@ux1.cso.uiuc.edu (Ed Kubaitis) Newsgroups: comp.windows.x Subject: xfroot patch Message-ID: <1989Sep28.124437.11132@ux1.cso.uiuc.edu> Date: 28 Sep 89 12:44:37 GMT Sender: news@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 29 The attached patch fixes a problem introduced getting xfroot ready to post to comp.sources.x last weekend. The problem caused the sign of user-supplied fractal parameters to be randomly changed. *** xfroot.c.orig Sat Sep 23 11:14:26 1989 --- xfroot.c Mon Sep 25 08:12:48 1989 *************** *** 90,98 hopset() { int r = Ranfseed; double pmax=1.0*W, logpmax=log(pmax); ! A = (A) ? A : exp(Ranf()*logpmax); if (r&2) A = -A; ! B = (B) ? B : exp(Ranf()*logpmax); if (r&4) B = -B; ! C = (C) ? C : Ranf()*pmax; if (r&8) C = -C; } --- 90,98 ----- hopset() { int r = Ranfseed; double pmax=1.0*W, logpmax=log(pmax); ! if (!A) { A = exp(Ranf()*logpmax); if (r&2) A = -A; } ! if (!B) { B = exp(Ranf()*logpmax); if (r&4) B = -B; } ! if (!C) { C = Ranf()*pmax; if (r&8) C = -C; } }