Docs are pretty wide with examples, but sad thing sometimes it doesnt contain the information about flags/etc. It's great that SymPy is opensource so you can go though sourses and read comments here or at least note what attributes function has.
понедельник, 4 ноября 2013 г., 10:15:40 UTC+4 пользователь Aaron Meurer написал: > > Don't worry, a lot of people miss the chop option. We should probably > add a note about it to the evalf section of the tutorial. > http://docs.sympy.org/latest/tutorial/basic_operations.html#evalf. > > Aaron Meurer > > On Sun, Nov 3, 2013 at 11:10 PM, Alexander Birukov > <[email protected]<javascript:>> > wrote: > > Oh, sorry. > > > > chop=<bool> > > Replace tiny real or imaginary parts in subresults > > by exact zeros (default=False) > > > > No idea how I missed it. Instead, I was trying to make n/precision lower > and > > round it. > > > > Thanks for your help again. > > > > понедельник, 4 ноября 2013 г., 7:59:59 UTC+4 пользователь Aaron Meurer > > написал: > >> > >> When evalf gives such a small number, it is zero. The precision of > >> evalf by default is 15 digits, so 10**-140 and 0 are no different at > >> that precision. > >> > >> You can make evalf automatically reduce such small numbers by passing > >> chop=True, like log(x, 2).evalf(subs={x: 1}, chop=True). > >> > >> Aaron Meurer > >> > >> > >> On Sun, Nov 3, 2013 at 2:04 PM, Alexander Birukov <[email protected]> > >> wrote: > >> > I dont really understand why it happens, although solve(log(x, 2)) > gives > >> > 1 > >> > as an answer. I'd use solve for sure, but unfortunetly, I have to > >> > calculate > >> > expression with different x. > >> > Any solution to fix this? > >> > > >> > -- > >> > 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 [email protected]. > >> > To post to this group, send email to [email protected]. > >> > 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 [email protected] <javascript:>. > > To post to this group, send email to [email protected]<javascript:>. > > > 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. For more options, visit https://groups.google.com/groups/opt_out.
