Re: Floor Not An Integer?
- To: mathgroup at smc.vnet.net
- Subject: [mg56520] Re: Floor Not An Integer?
- From: David Bailey <dave at Remove_Thisdbailey.co.uk>
- Date: Thu, 28 Apr 2005 02:40:06 -0400 (EDT)
- References: <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
Scott Guthery wrote: > I'm trying to use some of the NumericalMath approximations such as > MiniMaxApproximation and RationalInterpolation with a function that > includes array references of the form Array[[Floor[x]]]. The function > plots and evaluates just fine but the NumericalMath functions are > reporting the error: > > "Part::pspec: Part specification Floor[x] is neither an integer nor a > list of integers." > > whereas the documentation states that Floor[x] IS an integer. > > What am I missing? > > Thanks for any insight. > > Cheers, Scott > Mathematica is complaining that at that point x did not have a value, so Floor[x] remained unevaluated rather than presenting an integer to the Part operation. BTW, 'Array' is a built-in function - don't use it as a variable! Presumably you expected x to have a value at this point, so perhaps you should post a little more code - unless you have figured out the problem by now. David Bailey dbaileyconsultancy.co.uk