Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Re: Precision of output

  • To: mathgroup at smc.vnet.net
  • Subject: [mg48242] RE: [mg48209] Re: Precision of output
  • From: "DrBob" <drbob at bigfoot.com>
  • Date: Wed, 19 May 2004 02:42:22 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

x=N[4209/0.14,100]
Precision@x

30064.28571

MachinePrecision

The output is machine precision, and hence is formatted to 6 digits by
default. Use NumberForm to see more digits.

NumberForm[x,20]

30064.28571428572

We have only Machine precision, despite using N[#,100]&, because 0.14 is
machine precision (NOT 2-digit precision). N is having no effect at all,
because it's being asked for more precision in the output than in the input.
SetPrecision can be used for that. You're getting extra precision that's
actually meaningless, of course.

NumberForm[4209/0.14,20]
4209/0.14//Precision

30064.28571428572

MachinePrecision

SetPrecision[4209/0.14,100]

30064.2857142857137660030275583267211914062500000000000000000000000000000000
00\
00000000000000000000000

DrBob

www.eclecticdreams.net


-----Original Message-----
From: Kazimir [mailto:kazimir04 at yahoo.co.uk] 
To: mathgroup at smc.vnet.net
Subject: [mg48242] [mg48209] Re: Precision of output

> N[4209/0.14,100] I get:
> 30064.3

Mathematica thinks that only the first two digits are precise and
knows nothing about the consecutive digits. In other words it's a
standor notation for any number between 0.13500000(continue) and
0.1449999999(continue). Thus, it can not suppose that it will find a
preciser answer. To get the desired answer you have to ask
N[4209/SetPrecision[0.14, &#8734;], 100]
or 
4209/(0.14``100)
In the latest case you say that 0.14 is defined with 100 digits and it
finds the result with this precision


> But if I write N[420900/14,100] I get:
> 30064.285714285714285714285714285714285714285714285714285714285714285714
> 285714\
> 28571428571428571428571
Here, you don't put a digital point for 14, thus MATHEMATICA is sure
that 14 is 14, and not 13.85 or 14.45 sumthing else, and it finds 100
points. If you add only a digital point like this
N[420900/14., 100]
you will have the first result.

Vlad




  • Prev by Date: Module and database combined
  • Next by Date: Re: RE: Re: Finding errors in my code?
  • Previous by thread: RE: Re: Precision of output
  • Next by thread: RE: Re: Precision of output