how to compute difference between numers?

Giorgio's icon

I don't remember if there is any object that can calulate the difference between two numbers:

esample:

22 and 40 = 18
29 and 26 = 3

I don't use a "-" for I don't want negative numebrs:
like:

22 -40 = -18

It would be interesting if I could have the same operation done with lists of numbers:

22 10 55 66 23 VS
40 50 60 20 125 =
18 40 5 46 102

riccardo dapelo's icon

You could use "abs" after "-" to avoid negative numbers.

Hi,
riccardo

Giorgio's icon

DOH! thanks! my memory is getting rusty..

can i also compute lists?

francesco.rosati's icon

yes [abs] is the right way. You could use [vexpr] object to compute the difference between two lists, check [vexpr] help.

cheers

Giorgio's icon

thanks indeed

Peter Castine's icon

Actually and for the record, you *can* do this with a single external. If you want to.

I was going to point you to www.maxobjects.com, but I see that the object in question hasn't been listed there yet. Solo culpa mea. So I fear I will, yet again, have to resort to a plug.

The object is called lp.delta. URI below.

Best, Peter

Lê Quan Ninh's icon
Peter Castine's icon

>Just to remind to everyone that maxobjects.com can be feed by everybody.

Sorry, I meant to add that the fact that lp.delta is missing is nobody's faux mais de moi.

My internet access is limited to a dial-up while I am in the US, perhaps to the relief of some list readers. So updating my babies will remain, FBOW, on the to-do list until I get back to Berlin.

Great work on maxobjects.com, it's a great resource that I plug, well, not quite as much as Litter Power or iCE, but close.

Best -- Peter