Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: kyllopardiun on June 08, 2011, 10:11:27 pm

Title: Weird Nspire bug //do not evaluate at all
Post by: kyllopardiun on June 08, 2011, 10:11:27 pm
I got this buggy "Program":

Spoiler For "Bugged Source":
Define LibPub desolves_homo(fx,y,x)=
Prgm
::Local vector
::If right(fx)≠0 Then
::Return "Not Homo ODE"
::Else
::Disp "vector calculating"
::exp2vector(fx,y,x)→vector
::Disp "Done"
::Return desolve_h(vector,x)
::EndIf
:EndPrgm

The program cannot evaluate that bolded line, however,
I can calculate this : desolve_h(exp2vector(fx,y,x),x)

//Nspire OS 1.6
Title: Re: Weird Nspire bug //do not evaluate at all
Post by: Deep Toaster on June 08, 2011, 11:56:48 pm
Maybe vector is a reserved keyword? Just taking a stab here (I don't actually have an Nspire).
Title: Re: Weird Nspire bug //do not evaluate at all
Post by: kyllopardiun on June 09, 2011, 01:05:25 am
no it isn't, as I've used it before like 9=:vector;
for testing purposes and it worked.
Title: Re: Weird Nspire bug //do not evaluate at all
Post by: Levak on June 09, 2011, 05:50:40 am
Can you submit the exp2vector source code and an application example also ?
Because, here, there is no mistake.
Title: Re: Weird Nspire bug //do not evaluate at all
Post by: kyllopardiun on June 09, 2011, 09:16:44 am
I thought it would be easier for you, if you get the .tns,
so it's attached here.

//there are examples of how those functions should work
Title: Re: Weird Nspire bug //do not evaluate at all
Post by: Levak on June 09, 2011, 11:47:37 am
I can't manage to get your error, but, if I save the function (you forgot to do so ?) with Ctrl+B, and reevaluate the last sample, I get an infinite loop in exp2vector() on line 6. In a way, I don't understand anything about the numerical assignations inside exp2vector(), but I think you tried to convert a0 * X0^n + a1 * X1^n-1 + a2 * X2^n-2 + ... + an to [a0, a1, ..., an] didn't you ? Because you can do this with the built-in function polyCoeffs() (available at least in OS 3.0, don't know if it exists before) and returns {a0, a1, ..., an}.

I Hope this helped you.
Title: Re: Weird Nspire bug //do not evaluate at all
Post by: kyllopardiun on June 09, 2011, 06:18:08 pm
polyCoeffs() is exactly what I was trying to do in exp2vector().

Thanks,