Kopp, Philip F wrote:
> Hi, I am trying to work with a rather large sum(>200 terms) in Mathematica , but the program displays some odd behavior.
> When I multiply each term in the sum by 1, I get 1 for the answer. When I change 1 to 1.0, I get an incredibly large number for the answer.
> There seems to be some problem with using decimal numbers in this large sum. I tried Rationalize[1.0], and it works. What I am really trying to do is multiply each term by a different number(all less than one) that I calculated in another program. These numbers are in decimal form, so I run into the same problem. When I try rationalize here, it doen't fix the problem. Any other suggestions?
I am not totally sure whether this is what you are looking for, but have
you try to set to zero the second argument of Rationalize? The online
help points out that, "Rationalize[x, 0] converts any number x to
rational form." For instance,
In[1]:= Rationalize[N[Pi]]
Rationalize[N[Pi], 0]
% // N
%%% == %
Out[1]= 3.14159
Out[2]= 245850922/78256779
Out[3]= 3.14159
Out[4]= True
HTH,
-- Jean-Marc