[Date Index] [Thread Index] [Author Index]
Re: Floor Not An Integer?
Mathematica grumps about Floor[x] not being an integer in this expression: Device[x_] := sigs[[Floor[x]]] + (x - Floor[x])(sigs[[Ceiling[ x]]] - sigs[[Floor[x]]]) but it does NOT grump about Floor[x] not being an integer in this expression: Device[x_] := Which[x <= 1, 0, x ? 255, 100, True, sigs[[Floor[x]]] + (x - Floor[x])(sigs[[Ceiling[ x]]] - sigs[[Floor[x]]])] Why should the Which[..] construct make a difference? Thanks for any insight. Cheers, Scott -----Original Message----- From: DrBob [mailto:drbob at bigfoot.com] To: mathgroup at smc.vnet.net Subject: [mg56587] Re: [mg56493] Floor Not An Integer? Floor[x] is NOT an integer, unless x is a NUMBER. Bobby On Tue, 26 Apr 2005 21:53:01 -0400 (EDT), Scott Guthery <sguthery at mobile-mind.com> 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 > > > > -- DrBob at bigfoot.com