Re: NumberForm question
- To: mathgroup at smc.vnet.net
- Subject: [mg82006] Re: [mg81985] NumberForm question
- From: DrMajorBob <drmajorbob at bigfoot.com>
- Date: Tue, 9 Oct 2007 05:38:24 -0400 (EDT)
- References: <20828645.1191825480672.JavaMail.root@m35>
- Reply-to: drmajorbob at bigfoot.com
I thought I had an answer: the 2 in your InputForm output is in the 17th
decimal position (counting from the leading decimal as 1st position), so
16-digit precision leaves it out in the NumberForm output.
$MachineEpsilon
2.22045*10^-16
BUT:
NumberForm[x,{100,100}]
1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
From that, I'd think x is simply 1.0 (contradicting the InputForm).
But no, since:
RealDigits[x, 2]
{{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1}, 1}
So... you got me, I have no idea why!
Bobby
On Mon, 08 Oct 2007 01:03:48 -0500, Yaroslav Bulatov
<yaroslavvb at gmail.com> wrote:
> x=1+$MachineEpsilon;
> InputForm[x]
> NumberForm[x,{16,16}]
>
> Why does the result printed by NumberForm seem smaller?
>
>
>
--
DrMajorBob at bigfoot.com