Best way to compute length of arbitrary dimension vector?

Gabriel snoopy.67.z at googlemail.com
Wed Jun 1 15:35:13 EDT 2011


> py> def f2(*args):
> ...   return math.sqrt(math.fsum(x*x for x in args))

Wow! Thanks a million - I didn't now about math.fsum!

Best regards,
Gabriel.



More information about the Python-list mailing list