I guess you're using sympy? You may need to ask a sympy mailing list. Jupyter shouldn't be affecting what your code actually does, but it may be that your code finds a different version of sympy.
On 19 June 2017 at 22:10, fenixjose <[email protected]> wrote: > From this program............. > > num = 4 > x, u = symbols('x u') > Irr = Function('Irr')(u) > Irr = 4*pi**2*u**2*Abs(integrate(0.25*(1-cos(2*pi*x*num))*exp(-I*2*pi*u*x), > (x, 0, 1)))**2 # Notice the use of Abs function. > print(N(Irr.subs(u,1.1))) > > The result is .................. > > 0.0279388389446924 + 1.23479674389006e-24*I > But it is supposed to be a real number, not a complex, even with an imaginary > part close to zero !!! > > On the other hand, the same program on PyCharm - Python 3.5 is > 0.0279388389446924 (just real number) > > Am I doing something wrong? > > My system is............. > The version of the notebook server is *4.2.3* and is running on: > Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul 2 2016, 17:53:06) > [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] > > -- > You received this message because you are subscribed to the Google Groups > "Project Jupyter" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/jupyter/0e640955-2525-466e-9437-3dc14b05ee8f%40googlegroups.com > <https://groups.google.com/d/msgid/jupyter/0e640955-2525-466e-9437-3dc14b05ee8f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Project Jupyter" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/CAOvn4qi3%3Ddo6CGYM1AY7O2bT6ZaCFqHSpPw2x7PBQGCC4qeJmA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
