Hi,

On Sun, Feb 22, 2009 at 2:23 PM, Fabian Seoane <fabian.seo...@gmail.com> wrote:
>
>
> On Sun, Feb 22, 2009 at 12:30 PM, Freddie Witherden <fred...@witherden.org>
> wrote:
>>
>> Hi all,
>>
>> I am interested if there are currently any plans to add some form of
>> precision tracking for variables, be it through sympy or mpmath. The current
>> implementation will more than happily compute sin(0.50) to 100+ decimal
>> places if asked, even though the argument is only accurate to two decimal
>> places.
>
> hi Freddie. Currently you can set the precission (not globaly) with
> evalf(precission). For example:
>
>>>> sin(1).evalf(100)
> 0.8414709848078965066525023216302989996225630607983710656727517099919104043912
> 396689486397435430526959

Yes, but what Freddie means is that:

In [2]: sin(S(0.50).evalf(2)).evalf(100)
Out[2]:
0.4794255386042030002732879352155713880818033679406006751886166131255350002878
148322096312746843482691

Should not return 100 places, if 0.50 is only know to 2 decimal places.

>
> Hope it helps
>
>>
>> In Mathematica this feature is implemented as follows:
>> In: N[Sin[SetPrecision[0.50, 2]], 100]
>> Out: 0.48
>>
>> Notice how even though the sine of 0.5 was requested to 100 places of
>> accuracy it was only given to two as that is the maximum allowed by the
>> input. Naturally combing of numbers of various precisions is also handled
>> automatically.
>>
>> Something like this would be very useful for Sympy and would make
>> scientific calculations a lot easier.

Thanks for reporting it. I think this is should be implemented, either
in mpmath or sympy. Fredrik, what do you think about it?

Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com
To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to