Re: NSum bug or am I doing something wrong?
- To: mathgroup at smc.vnet.net
- Subject: [mg93911] Re: NSum bug or am I doing something wrong?
- From: "sjoerd.c.devries at gmail.com" <sjoerd.c.devries at gmail.com>
- Date: Fri, 28 Nov 2008 05:09:15 -0500 (EST)
- References: <gglt0i$8j7$1@smc.vnet.net>
ebpr,
This result isn't specific to 7.0. Version 6.0 and probably others
have this as well. It is caused by the approximating algorithms of
NSum. A small change in your command will change this:
NSum[(-1)^(k + 1)*(2/10)^k, {k, 1, 32}, WorkingPrecision -> 10]
Cheers -- Sjoerd
On Nov 27, 12:32 pm, "Ebpr Preb" <ebp... at gmail.com> wrote:
> Hi,
>
> I'm getting imaginary answers for simple NSums of rational numbers. The
> example below produces the issue in Mathematica 7:
>
> NSum[(-1)^(k + 1)*(.2)^k, {k, 1, 32}]
>
> gives me the result:
>
> 0.166667 + 1.1972*10^-44 I
>
> When I switch to Sum the problem disappears.
>
> Any hint?
>
> Thanks so much.
>
> ebpr