Hello,
I am working on creating a CDF file for a calculation where I do high-precision evaluation of functions such as N[func,40]. I wrote a Module that takes user function and rationalize it, this way I create a function with user input accuracy. (Shown Below). When I don’t use an inputfield my module works well but with inputfield I can’t prevent it to be evaluated.
Sorry, but I dont fully understand what you want to achieve.
However, if I declare Res as a Dynamic variable, outside of the DynamicModule itself, it returns the expected number of digits after pressing Calculate in the DynamicModule:
It is expected number of digits that is true but is it right? Forget about Sin. When I evaluate fg and fg2 with 40 digits fg2 has the right digits not fg . Because it is already evaluated before setting the accuracy after machine zero the digits are not right. My goal is to avoid that and evaluate fg when I need to evaluate with right digits.
In[190]:= fg = Pi/2.1;
Print[fg];
fg2 = Pi/(21/10);
Print[fg2];
SetAccuracy[fg, 40]
SetAccuracy[fg2, 40]
During evaluation of In[190]:= 1.4959965017094252
During evaluation of In[190]:= (10 \[Pi])/21
Out[194]= 1.4959965017094252193174952481058426201344
Out[195]= 1.495996501709425351648877801561668040094