MathGroup Archive 2006

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

Search the Archive

Re: Why polynomial Can't output as single Number?


William wrote:
> data={7,2,3,25,1,10};
> f=InterpolatingPolynomial[data,x];
> f/.x->5;
> 
> Result as attachment picture.
> 
> why can't get a simply number?
> 
> thanks
> 
> Please see picture:
> http://lh3.google.com/sunose/RO6YrIfQABI/AAAAAAAAAHM/Mv4mNbq31mI/polynomial.JPG
> 
> thanks
> 

Works fine here. Try with a fresh kernel without loading any packages to 
see what happens.

In[1]:=
data = {7, 2, 3, 25, 1, 10};
f = InterpolatingPolynomial[data, x];
f /. x -> 5

Out[3]=
1

In[4]:=
N[f /. x -> 5]

Out[4]=
1.

In[5]:=
N[f /. x -> 5, 2]

Out[5]=
1.0

In[6]:=
dd = N[f /. x -> 5, 2]

Out[6]=
1.0

In[7]:=
Head[dd]

Out[7]=
Real

In[8]:=
$Version

Out[8]=
5.2 for Microsoft Windows (June 20, 2005)

HTH,
Jean-Marc


  • Prev by Date: Re: General--IF condition in Plot3D
  • Next by Date: Re: Selecting Lists Without Null Results
  • Previous by thread: Re: Why polynomial Can't output as single Number?
  • Next by thread: change of default behavoir for workbench