Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: Raylin on June 01, 2010, 11:25:24 pm

Title: Check if there are changes between two lists?
Post by: Raylin on June 01, 2010, 11:25:24 pm
Is there a way to do this?
I think there is a relativity test for this but it escapes me.

First try:
:If {A,B,C,D,E,F,G,H,I,J,L,M,N}<>LLTSAV

Second try:
:If (delta)List({A,B,C,D,E,F,G,H,I,J,L,M,N})<>((delta)List(LLTSAV)

sum() has that possibility of the sums still equaling. So, I don't want to use that...
Title: Re: Check if there are changes between two lists?
Post by: Builderboy on June 01, 2010, 11:27:41 pm
Mmm you want to see if two lists are exactly equal you mean?
Title: Re: Check if there are changes between two lists?
Post by: _player1537 on June 01, 2010, 11:28:32 pm
didn't test this, but will this work?

Code: [Select]
if (sum(L1=L2))=Dim(L1
[the lists match]

Edit: but first you should make sure the dimensions are the same
Title: Re: Check if there are changes between two lists?
Post by: cooliojazz on June 01, 2010, 11:31:24 pm
you mean like max({1,2}=|={2,2}) which will return 1 because the are not the same?
Title: Re: Check if there are changes between two lists?
Post by: Raylin on June 01, 2010, 11:35:18 pm
@player: It works!

I need to see how that evaluates! That is funky!

EDIT: I understand now! L1 and L2 performs the relativity test and returns a list. You find the sum of that list and if it's the dimensions of the original list, then execute the code...

Awesome! :D
Title: Re: Check if there are changes between two lists?
Post by: cooliojazz on June 01, 2010, 11:50:03 pm
seeing what youre trying to do, i think min(L1=L2) should be better...
Title: Re: Check if there are changes between two lists?
Post by: Deep Toaster on June 01, 2010, 11:53:18 pm
didn't test this, but will this work?

Code: [Select]
if (sum(L1=L2))=Dim(L1
[the lists match]

Edit: but first you should make sure the dimensions are the same

you mean like max({1,2}=|={2,2}) which will return 1 because the are not the same?

Does anyone know which command is faster? I'd think it's max(, but I'm not sure.
Title: Re: Check if there are changes between two lists?
Post by: Builderboy on June 02, 2010, 12:02:49 am
you want not(min(L1=L2   and i belive max(L1=/=L2 is faster but i did not test it
Title: Re: Check if there are changes between two lists?
Post by: ztrumpet on June 02, 2010, 08:48:54 am
I think you want min(L1=L2.  This will return 1 if L1 and L2 are equal everywhere. :)
Title: Re: Check if there are changes between two lists?
Post by: cooliojazz on June 02, 2010, 10:17:47 am
no, because {1,2}={1,1} will be {1,0} of which the max is 1 even tho it is not completely equal.  That's only for if you just want to know if any are equal.  You would have to do what builderboy said (which is also what i said :P)
Title: Re: Check if there are changes between two lists?
Post by: ztrumpet on June 02, 2010, 04:41:49 pm
no, because {1,2}={1,1} will be {1,0} of which the max is 1 even tho it is not completely equal.  That's only for if you just want to know if any are equal.  You would have to do what builderboy said (which is also what i said :P)
Gah, sorry, I definitely failed.  Min is correct.  Thanks for pointing it out. :