[Date Index]
[Thread Index]
[Author Index]
Re: sum question
*To*: mathgroup at smc.vnet.net
*Subject*: [mg91208] Re: sum question
*From*: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
*Date*: Sat, 9 Aug 2008 07:47:19 -0400 (EDT)
*Organization*: The Open University, Milton Keynes, UK
*References*: <g7h9q1$bbd$1@smc.vnet.net>
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
Prev by Date:
**Re: Solving complex equations**
Next by Date:
**Re: Re: Multiplying a vector over multiple vectors**
Previous by thread:
**Re: sum question**
Next by thread:
**Re: Re: sum question**
| |