Author: bugman Date: Thu Apr 3 10:49:57 2008 New Revision: 5256 URL: http://svn.gna.org/viewcvs/relax?rev=5256&view=rev Log: Merged revisions 5255 via svnmerge from svn+ssh://bugman@xxxxxxxxxxx/svn/relax/1.3 ........ r5255 | bugman | 2008-04-03 10:31:42 +0200 (Thu, 03 Apr 2008) | 7 lines Another fix for bug #11004 (https://gna.org/bugs/?11004). This actually isn't a new bug as suggested in the emails (see the bug report for links). It is the same division by zero problem as was fixed in r5117 (1.3 line) and r5119 (1.2 line), just a few lines down. ........ Modified: 1.2/ (props changed) 1.2/generic_fns/monte_carlo.py Propchange: 1.2/ ------------------------------------------------------------------------------ --- svnmerge-integrated (original) +++ svnmerge-integrated Thu Apr 3 10:49:57 2008 @@ -1,1 +1,1 @@ -/1.3:1-2505,2941,2947,2950,2974,2976,2979,2984,2988,3076,3083-3084,3087,3117,3299,3309,3312,3314,3318,3345,3372,4145,4473,4476,4939,5117 +/1.3:1-2505,2941,2947,2950,2974,2976,2979,2984,2988,3076,3083-3084,3087,3117,3299,3309,3312,3314,3318,3345,3372,4145,4473,4476,4939,5117,5255 Modified: 1.2/generic_fns/monte_carlo.py URL: http://svn.gna.org/viewcvs/relax/1.2/generic_fns/monte_carlo.py?rev=5256&r1=5255&r2=5256&view=diff ============================================================================== --- 1.2/generic_fns/monte_carlo.py (original) +++ 1.2/generic_fns/monte_carlo.py Thu Apr 3 10:49:57 2008 @@ -218,7 +218,7 @@ # Calculate the mean parameter value for all simulations. if n == 0: - Xav = 0 + Xav = 0.0 else: Xav = Xsum / float(n) @@ -237,7 +237,10 @@ sd = sd + (param_array[i] - Xav)**2 # Calculate the standard deviation. - sd = sqrt(sd / (float(n) - 1.0)) + if n <= 1: + sd = 0.0 + else: + sd = sqrt(sd / (float(n) - 1.0)) # Simulation parameters with the value None. else: