[Avida-SVN] r1520 - development/source/actions

baerb at myxo.css.msu.edu baerb at myxo.css.msu.edu
Thu May 3 07:38:52 PDT 2007


Author: baerb
Date: 2007-05-03 10:38:52 -0400 (Thu, 03 May 2007)
New Revision: 1520

Modified:
   development/source/actions/PrintActions.cc
Log:

Added casting an integer to double  inside a log function. Needed on the
HPC.



Modified: development/source/actions/PrintActions.cc
===================================================================
--- development/source/actions/PrintActions.cc	2007-05-03 13:22:28 UTC (rev 1519)
+++ development/source/actions/PrintActions.cc	2007-05-03 14:38:52 UTC (rev 1520)
@@ -901,7 +901,7 @@
 				for (int c = 0; c < inst_count.GetSize(); c++)
 				{
 					double p = (inst_count[c] > 0) ? inst_count[c] / static_cast<double>(total_count) : 0.0;
-					site_entropy[pos] += (p > 0.0) ? - p * log(p) / log(inst_count.GetSize()) : 0.0;
+					site_entropy[pos] += (p > 0.0) ? - p * log(p) / log(static_cast<double>(inst_count.GetSize())) : 0.0;
 				}
 			}
 		}




More information about the Avida-cvs mailing list