My Python code was doing something strange to me (or my numbers, rather):
a)
float(poverb.tangibles[1])*1000
1038277000.0
b)
float(poverb.tangibles[1]*1000)
inf
Which led to discovering that:
long(poverb.tangibles[1]*1000)
produces the largest number I’ve ever seen.
Uhhh, I didn’t read the whole Python tutorial or it’s doc. Did I miss something critical about how float works?
EDIT:
>>> poverb.tangibles[1]
u'1038277'
What you probably missed is docs on how multiplication works on strings. Your
tangibleslist contains strings.tangibles[1]is a string.tangibles[1]*1000is that string repeated 1000 times. Callingfloatorlongon that string interprets it as a number, creating a huge number. If you instead dofloat(tangibles[1]), you only get the actual number, not the number repeated 1000 times.What you are seeing is just the same as what goes on in this example: