Author Topic: Weird Nspire bug //do not evaluate at all  (Read 2972 times)

0 Members and 1 Guest are viewing this topic.

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
Weird Nspire bug //do not evaluate at all
« 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

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Weird Nspire bug //do not evaluate at all
« Reply #1 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).




Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
Re: Weird Nspire bug //do not evaluate at all
« Reply #2 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.

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: Weird Nspire bug //do not evaluate at all
« Reply #3 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.
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
Re: Weird Nspire bug //do not evaluate at all
« Reply #4 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

Offline Levak

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +208/-39
    • View Profile
    • My website
Re: Weird Nspire bug //do not evaluate at all
« Reply #5 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.
« Last Edit: June 09, 2011, 11:48:14 am by Levak »
I do not get mad at people, I just want them to learn the way I learnt.
My website - TI-Planet - iNspired-Lua

Offline kyllopardiun

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 178
  • Rating: +14/-4
  • Kyllopardiun over 2000 results in google.
    • View Profile
    • Kyllo's blog (a blog about poetry, videos and computing)
Re: Weird Nspire bug //do not evaluate at all
« Reply #6 on: June 09, 2011, 06:18:08 pm »
polyCoeffs() is exactly what I was trying to do in exp2vector().

Thanks,