       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:=
o = Cos[31^(1/3)]; (*a number very close to -1; see
http://mathworld.wolfram.com/AlmostInteger.html)

Then

In:=
N@o

Out=
-1.

In:=
N@o//InputForm

Out//InputForm=
-0.999999977527746

In:=
o//N[#,MachinePrecision]&//InputForm

Out//InputForm=
-0.999999977527746

But

In:=
o//N[#,\$MachinePrecision]&//InputForm

Out//InputForm=
-0.9999999775277460225993505331`15.954589770191003

Almost 16 digits of precision.

Also execute the following command

In:=
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:=N[Exp[Sqrt[163 ]Pi] - 6403203]
> Out=256.
>
>
> c)
> In:=N[Exp[Sqrt[163 ]Pi] - 6403203,\$MachinePrecision]
> Out=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