jeffalstott / powerlaw

603 stars 134 forks source link

divide by 0 warnings #76

Open charlesmartin14 opened 5 years ago

charlesmartin14 commented 5 years ago

let me suggest using

(Theoretical_CDF * (1 - Theoretical_CDF)+0.0000001) on line 700 of

r-menezes commented 4 years ago

Another good option would be to use the machine precision epsilon for floating number:

(Theoretical_CDF * (1 - Theoretical_CDF)+np.finfo(float).eps) # machine precision epsilon

A previous definition eps = np.finfo(float).eps # machine precision epsilon could also make the code more readable