       Re: Mathematica bugs?

• To: mathgroup at smc.vnet.net
• Subject: [mg67316] Re: Mathematica bugs?
• From: "David W.Cantrell" <DWCantrell at sigmaxi.org>
• Date: Sun, 18 Jun 2006 05:13:02 -0400 (EDT)
• References: <e70f29\$rf4\$1@smc.vnet.net>
• Sender: owner-wri-mathgroup at wolfram.com

```"Yaroslav Bulatov" <yaroslavvb at gmail.com> wrote:
> When I run the following line
> x = Pi/4; For[i = 0, i < 56, i += 1, x = 2*Abs[x - 1/2]]; N[x]
> I get 3.
>
> But x should always stay between 0 and 1, why do I get 3?
>
> Also
> x = Pi/4; For[i = 0, i < 50, i += 1, x = 2*Abs[x - 1/2]]; N[Log[x]]
> gives me Indeterminate
>
> How can I get an indeterminate here?

Just ask for more precision from N:

In:=
x = Pi/4; For[i = 0, i < 56, i += 1, x = 2*Abs[x - 1/2]]; N[x,20]

Out=
0.79387245267980382900

In:=
x = Pi/4; For[i = 0, i < 50, i += 1, x = 2*Abs[x - 1/2]]; N[Log[x],20]

Out=
-3.3676443458316025909

David Cantrell

```

• Prev by Date: Re: Problem with derivate of product
• Next by Date: Re: Problem with derivate of product
• Previous by thread: Re: Mathematica bugs?
• Next by thread: Re: Mathematica bugs?