I'm not sure if SymPy has much to say in the matter. This strikes me
as entirely NumPy's behavior.

Aaron Meurer

On Sat, Jan 18, 2014 at 3:05 PM, F. B. <franz.bona...@gmail.com> wrote:
> I came across with this strange behavior:
>
> In [1]: o=numpy.array(3, dtype=object)
>
> In [2]: o
> Out[2]: array(3, dtype=object)
>
> In [3]: o.ndim
> Out[3]: 0
>
> In [4]: S.One*o
> Out[4]: 3.00000000000000
>
> In [7]: e=numpy.array([3], dtype=object)
>
> In [8]: e.ndim
> Out[8]: 1
>
> In [9]: S.One*e
> Out[9]: 3.00000000000000
>
> In [10]: u = numpy.array([3, 4, 5], dtype=object)
>
> In [11]: S.One*u
> Out[11]: array([3, 4, 5], dtype=object)
>
>
> When S.One gets multiplied by either a rank zero or rank one numpy.ndarray
> with a sympy integer or python integer, the result is converted to float. I
> think this is the default behavior in numpy upon multiplication by python
> integers.
>
> But is this good when the multiplication involves sympy integers? I think
> that the result should still be a sympy integer.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to