On Saturday, January 4, 2014 2:21:29 AM UTC+1, Thierry (sage-googlesucks@xxx) wrote: > > On my Sage 6.0, i first get a warning (according to > http://sourceforge.net/projects/numpy/files/NumPy/1.5.0/NOTES.txt/view > the message comes from numpy): > sage: 1j / np.float64(2) > > /opt/sagemath/sage-6.0-i686-Linux/src/bin/sage-ipython:1: > ComplexWarning: Casting complex values to real discards the imaginary > part > #!/usr/bin/env python > 0.0 > > So, this is not really a bug ;)
Issuing a warning doesn't make the result more correct. So in my eyes it is a bug. Actually, I don't see why a complex value should be casted to real in the process of the calculation above. Perhaps a real value could be casted to complex but not the other way round. Note also, that the problem does not occur in a python only environment (python/numpy without Sage): >>> import numpy as np >>> 1j / np.float64(2) 0.5j Cheers, Bernhard -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/groups/opt_out.