Reputation: 27
I can't calculate float logarithm
logahr = math.log(float (1.54)*hr, 10)
logfc = math.log(frek, 10)
loght = math.log(ht, 10)
#ahr formula
ahre = (8.29 * logahr**2)- 1.1
#pangkat formula
pangkat = ((69.55+26.16*logfc)-13.83*loght-ahre)/(6.55*loght - 44.9)
d = pow (10, float(pangkat))
print(d)
logahr = math.log(float (1.54)*hr, 10) TypeError: can't multiply sequence by non-int of type 'float'
Upvotes: 0
Views: 211
Reputation: 7206
before this line:
logahr = math.log(float (1.54)*hr, 10)
in your variable
hr
you havestring
,sequence
, or something else which is not integer or float number
if you have string:
logahr = math.log(float (1.54)*float(hr), 10)
if its sequence:
logahr = math.log(float (1.54)*float(hr[0]), 10)
anyway check what type you have in variable
hr
Upvotes: 0