Going past the float size limits?

Paul Rubin http
Sun Oct 28 20:22:13 CET 2007


Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> writes:
> You can't just say:
> product = map(operator.mul, [A*T*C*G]*200000)
> and expect to get anywhere.

from math import log
A,T,C,G = (0.35, 0.30, 0.25, 0.10)
c,m = divmod(200000*log(A*T*C*G,10), 1)
print "%.3fe%d"%(m, int(c))



More information about the Python-list mailing list