       Re: Mathematica precision for a^b

• To: mathgroup at smc.vnet.net
• Subject: [mg73505] Re: Mathematica precision for a^b
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Wed, 21 Feb 2007 01:33:09 -0500 (EST)
• Organization: The Open University, Milton Keynes, UK

```sonyaBabken at yahoo.de wrote:
> Hallo
> I am new to mathematica. I have mathematica 5.1.
> If I have the expresion a^b where a is  an arbitrary double precision
> decimal number and b is an exact number say a list from 1-10. How can
> I see that the precision of this expression changes when raising a to
> these powers?
> Sonya
>

Hi Sonya,

The precision of the results does not change: since you have a mix of
hardware precision numbers and exact numbers the overall precision is
lowered to machine precision and the computations are done using the
functions implemented in the hardware. Detailed explanations are given in
"The Mathematica Book Online / Advanced Mathematics in Mathematica /
Numbers / 3.1.4 Numerical Precision", available at

http://documents.wolfram.com/mathematica/book/section-3.1.4

To see the precision of a Mathematica expression, you can use the
built-in function Precision . For instance,

In:=
a = 2.;

In:=
Precision[a]

Out=
MachinePrecision

In:=
b = Range

Out=
{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

In:=
Precision /@ b

Out=
{Infinity, Infinity, Infinity, Infinity, Infinity,

Infinity, Infinity, Infinity, Infinity, Infinity}

In:=
a^b

Out=
{2., 4., 8., 16., 32., 64., 128., 256., 512., 1024.}

In:=
Precision /@ %

Out=
{MachinePrecision, MachinePrecision, MachinePrecision,

MachinePrecision, MachinePrecision,

MachinePrecision, MachinePrecision,

MachinePrecision, MachinePrecision, MachinePrecision}

In:=
\$MachinePrecision

Out=
15.9546

In:=
\$Version

Out=
5.2 for Microsoft Windows (June 20, 2005)

Regards,
Jean-Marc

 http://documents.wolfram.com/mathematica/functions/Precision

```

• Prev by Date: Re: Precision of a number raised to a power
• Next by Date: Re: FullGraphics question
• Previous by thread: Re: Approximate/asymptotic factorization
• Next by thread: ToMatlab limitations