|
[Date Index]
[Thread Index]
[Author Index]
Re: using N function
- To: mathgroup at smc.vnet.net
- Subject: [mg76336] Re: using N function
- From: dimitris <dimmechan at yahoo.com>
- Date: Sun, 20 May 2007 02:21:37 -0400 (EDT)
- References: <f2me6h$lu4$1@smc.vnet.net>
Watch the differences.
In[34]:=
o = Cos[31^(1/3)]; (*a number very close to -1; see
http://mathworld.wolfram.com/AlmostInteger.html)
Then
In[35]:=
N@o
Out[35]=
-1.
In[36]:=
N@o//InputForm
Out[36]//InputForm=
-0.999999977527746
In[37]:=
o//N[#,MachinePrecision]&//InputForm
Out[37]//InputForm=
-0.999999977527746
But
In[38]:=
o//N[#,$MachinePrecision]&//InputForm
Out[38]//InputForm=
-0.9999999775277460225993505331`15.954589770191003
Almost 16 digits of precision.
Also execute the following command
In[50]:=
FrontEndExecute[{HelpBrowserLookup["MainBook", "3.1.4", "4.14"]}]
You will be gone to a relevant section of Mathematica information with
enough information for understanding their differences!
Note that I don't know if the the last command works in version 6!
Dimitris
/ kkwweett :
> Good morning Mathematica users,
>
>
> Can anyone tell me, please, which of a),b) or c) is wrong :
>
> a)
> <MathematicaHelp>
> <quote>
>
> N[expr] is equivalent to N[expr, MachinePrecision].
>
> </quote>
> </MathematicaHelp>
>
> b)
> In[1]:=N[Exp[Sqrt[163 ]Pi] - 6403203]
> Out[1]=256.
>
>
> c)
> In[2]:=N[Exp[Sqrt[163 ]Pi] - 6403203,$MachinePrecision]
> Out[2]=743.9999999999993
>
> ?
>
> Thank you
Prev by Date:
Re: Number of Differing Digits & Another Problem (want to see different ways it can be done)
Next by Date:
Re: All permutations of a sequence
Previous by thread:
Re: using N function
Next by thread:
Re: using N function
|