Clip[1.00000000000000036, {0., 1.}]
gives
1.0000000000000004
upon close examination of the output. The documentation does not warn of
this behavior.
I have not checked if the same thing happens in Mathematica v8.
Just thought I would let you know.
Yen Lee
Yen Lee Loh <yenleel...@gmail.com> wrote:
> On Mathematica v7.0.1 on Mac OS X,
>
> Clip[1.00000000000000036, {0., 1.}]
>
> gives
>
> 1.0000000000000004
>
> upon close examination of the output. The documentation does not warn =
the bug seems to be handled in v8.0:
In[1]:= Clip[1.00000000000000036, {0., 1.}]
Out[1]= 1.
But comes back if I add one more zero before 36:
In[2]:= Clip[1.000000000000000036, {0., 1.}]
Out[2]= 1.00000000000000004
Istvan
On Jan 8, 9:40 am, Alexey <lehi...@gmail.com> wrote:
> Hello,
> I confirm this bug in Mathematica 5.2 and 7.0.1 under Windows.
>
> Yen Lee Loh <yenleel...@gmail.com> wrote:
>
> > On Mathematica v7.0.1 on Mac OS X,
>
> > Clip[1.00000000000000036, {0., 1.}]
>
> > gives
>
> > 1.0000000000000004
>
> > upon close examination of the output. The documentation does not warn of
In[86]:= 1.0 == 1.00000000000001
Out[86]= True
One zero less:
In[87]:= 1.0 == 1.0000000000001
Out[87]= False
Try using the exact number 1 as the upper limit (wihout decimal
point).
In[88]:= Clip[1.00000000000000036, {0., 1}]
Out[88]= 1
Cheers -- Sjoerd