]>
gitweb.michael.orlitzky.com - sage.d.git/blob - mjo/misc.py
2 Stuff that doesn't fit anywhere else.
6 from functools
import reduce
10 Return the LaTeX representation of `obj`, but wrap it in dollar
11 ($) signs so that we can pass it directly to plot() et al. as a
14 return '$%s$' % latex(obj
)
18 Returns the product of the elements in the list `factors`. If the
19 list is empty, we return 1.
23 Normal integer multiplication::
25 sage: product([1,2,3])
28 And with symbolic variables::
30 sage: x,y,z = var('x,y,z')
31 sage: product([x,y,z])
35 return reduce(operator
.mul
, factors
, 1)