Path: ns-mx!hobbes.physics.uiowa.edu!zaphod.mps.ohio-state.edu!rpi!news-server.csri.toronto.edu!helios.physics.utoronto.ca!neufeld From: neufeld@helios.physics.utoronto.ca (Christopher Neufeld) Newsgroups: comp.sys.apple2 Subject: Fixes to Accrete II sources Message-ID: <1992Jan27.060536.3052@helios.physics.utoronto.ca> Date: 27 Jan 92 06:05:36 GMT Sender: news@helios.physics.utoronto.ca (News Administrator) Organization: University of Toronto Physics/Astronomy/CITA Lines: 41 I've fixed a couple of problems in the source code to ACCRETEII, and now it works properly. Here are the changes I made: I seem to remember a problem with the randomization function which was used in the original program, so I included one which I know works. In the file 'main.c' change the init() function to the following: void init() { srand((int) time(NULL)); } Also, a very bizarre error in 'utils.c'. I don't know how it got changed to what it reads presently, but as written it generates numbers which fall outside the expected range, and lead to domain errors later in the program when negative numbers are called for 'x' with fractional 'y' in the pow(x,y) function. The change to make is in the last line. It should read as follows: double random_number (inner, outer) double inner, outer; { double range; range = outer - inner; return((((double)rand()) / (double)(RAND_MAX)) * range + inner); } The original text ended with ' - outer);'. I've repackaged the program and posted it to comp.binaries.apple2, for those people who don't want to compile it themselves. -- Christopher Neufeld....Just a graduate student | Note: New path. neufeld@helios.physics.utoronto.ca Ad astra | aurora will still cneufeld@pnet91.cts.com | forward my messages to "Don't edit reality for the sake of simplicity" | me on helios