       Re: On default numerical precision

• To: mathgroup at smc.vnet.net
• Subject: [mg90705] Re: On default numerical precision
• From: sergio_r at mail.com
• Date: Sun, 20 Jul 2008 06:33:22 -0400 (EDT)
• References: <g5pj07\$qbc\$1@smc.vnet.net> <g5s9q0\$51h\$1@smc.vnet.net>

```Jens thanks for you reply. I am not sure what
I am missing but here are the results of following
the sugested approach:

In:= \$Post = ( # /. a_Real :> NumberForm[a, {32, 16}]) &;

In:= a=2.

Out//NumberForm= 2.

In:= b=3.

Out//NumberForm= 3.

In:= a*b

Out//NumberForm= 6.

But the following form works the way I was looking
for:

In:= \$Post =.

In:= \$Post

Out= \$Post

In:= \$Post = ( # /. a_Real :> SetPrecision[a, 32]) &;

In:= a=2.

Out= 2.0000000000000000000000000000000

In:=  b=3.

Out= 3.0000000000000000000000000000000

In:= a*b

Out= 6.0000000000000000000000000000000

Thanks again,

Sergio

On Jul 19, 4:49 am, Jens-Peer Kuska <ku... at informatik.uni-leipzig.de>
wrote:
> Hi,
>
> \$Post = ( # /. a_Real :> NumberForm[a, {32, 16}]) &;
>
> Regards
>    Jens
>
> sergi... at mail.com wrote:
> > Hello all,
>
> > I am wonderin on how to change the mathematica default printing
> > precision, so I don't have to type on any defined constant the
> > required  precision, like " `30 "  in:
>
> > In:= a=2.3`30; b=2.1`30;
>
> > In:= a*b
>
> > Out= 4.83000000000000000000000000000
>
> > I would like  to be able to do:
>
> > a=2.3; b=2.1; and obtain
> > a*b = 4.83000000000000000000000000000
>
> > Regards,
>
> > Sergio
> > PS. Apparently the internal variable \$Pre could be set to do that, but
> > the respective help page [  http://reference.wolfram.com/mathematica/ref/\$Pre.html
> >    ] is not clear about how to do that.

```

• Prev by Date: Installing Personal Package Documentation not showing up
• Next by Date: Re: Can you help me rewrite my matlab code to mathematica code?
• Previous by thread: Re: On default numerical precision
• Next by thread: Re: On default numerical precision