Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69017] Re: Why polynomial Can't output as single Number?
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Sat, 26 Aug 2006 04:40:07 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <ecop0n$2ve$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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