Skip to content

Commit

Permalink
Ensure float value
Browse files Browse the repository at this point in the history
  • Loading branch information
fmder committed Apr 2, 2016
1 parent 18ce844 commit d7ffb88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/es/cma_bipop.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ def main(verbose=True):
# All components of pc and sqrt(diag(C)) are smaller than the threshold
conditions["TolX"] = True

if strategy.sigma / sigma > strategy.diagD[-1]**2 * TOLUPSIGMA:
# Need to transfor strategy.diagD[-1]**2 from pyp/numpy.float64 to python
# float to avoid OverflowError
if strategy.sigma / sigma > float(strategy.diagD[-1]**2) * TOLUPSIGMA:
# The sigma ratio is bigger than a threshold
conditions["TolUpSigma"] = True

Expand Down

0 comments on commit d7ffb88

Please sign in to comment.