       Re: Numerical accuracy/precision - this is a bug or a feature?

• To: mathgroup at smc.vnet.net
• Subject: [mg120162] Re: Numerical accuracy/precision - this is a bug or a feature?
• From: FranD <seacrofter001 at yahoo.com>
• Date: Sun, 10 Jul 2011 05:02:57 -0400 (EDT)

```Is using "`" an acceptable work-around?

a = 2.`30; b = Sqrt; c = a b;
check[x_] := {x, Precision[x]}

check[a]    {2.00000000000000000000000000000, 30.}
check[b]    {Sqrt, \[Infinity]}
check[c]    {2.82842712474619009760337744842, 30.}

-FranD

Slawek wrote:

> Let Mathematica (6.x, 7.x) compute quite a simple
> product
>
> In:= N[N[2.0, 20] * N[Sqrt , 20], 20]
>
> Out= 2.82843
>
> This is a bug.
>
> Why?
>
> Now we analyze it in details:
>
> 1. N[2.0,20] should give 2 with
> decimal digits, i.e. 2.00000000000000000000
>
> 2. Sqrt should give... Sqrt
>
> 3. N[Sqrt] should give 1.4142135623730950488 (this
> is copy-paste from
> Mathematica output to N[Sqrt] )
>
> 4. The product 2.00000000000000000000 *
> 1.4142135623730950488 is
> 2.8284271247461900976 (again copy-paste)
>
> 5. BUT THE RESULT OF  N[2.0, 20] * N[Sqrt , 20]
>  "truncated to 20 digits"
> is Out= 2.82843
>
> Where are missing digits?!
>
> slawek

```

• Prev by Date: Re: derivative of matrix in mathematica
• Next by Date: Re: derivative of matrix in mathematica
• Previous by thread: Re: Numerical accuracy/precision - this is a bug or a feature?
• Next by thread: Re: Numerical accuracy/precision - this is a bug or a feature?