Skip to content

Commit

Permalink
Update tradecalc.py (#7)
Browse files Browse the repository at this point in the history
Python uses ** for exponentiation, not the caret (^). Otherwise we get "TypeError: unsupported operand type(s) for ^: 'float' and 'float'". Also, am I scary enough to need scare quotes? That's not a handle, that's my name :)
  • Loading branch information
aadler authored and eyeonus committed Jun 19, 2018
1 parent 2475607 commit 1f001df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tradecalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ def annotate(dest):
# and after 4kls starts to penalize aggresively
# http://goo.gl/Otj2XP

# [eyeonus] As "aadler" pointed out, this goes into negative
# [eyeonus] As aadler pointed out, this goes into negative
# numbers, which causes problems.
#penalty = ((cruiseKls ** 2) - cruiseKls) / 3
#penalty *= lsPenalty
Expand Down Expand Up @@ -976,7 +976,7 @@ def sigmoid(x):

boost = (1 - sigmoid(25 * (cruiseKls - 1))) / 4
drop = (-1 - sigmoid(50 * (cruiseKls - 4))) / 4
penalty = (-1 + 1 / (cruiseKls + 1)^((cruiseKls + 1) / 4)) / 2
penalty = (-1 + 1 / (cruiseKls + 1) ** ((cruiseKls + 1) / 4)) / 2

multiplier += (penalty + boost + drop) * lsPenalty

Expand Down

0 comments on commit 1f001df

Please sign in to comment.