Mathematical operations on multiple numbers

I have been trying to figure out how best to run multiple maths operations on a list of numbers and so far I have to run the operation on 2 numbers and then use that result in the next operation and so on.

Maybe the block can be changed to have a gear function that allows you to add multiple operations in the same block.

You’ll need to provide more details about the operation. Can you give a specific example of values you might start with and intermediate calculations?

It sounds like you might need a recursive function.

Use blocks inside the block… like this

image

1 Like

Here’s an example of a simple sum that works for any list length:

I’m adding 0 to j to make it a numeric value (rather than a text string) but you could apply other calculations there such as 2*j, etc.

Will try this. Thanks.

Question is, does this follow PEDMAS principles.

It will depend upon how you arrange you blocks… consider each block as a bracket … that’s how I got it work. Please let’s know what do you discover.

Yes, that’s good advice. So this:

image

would be the same as this:

(1+(1x(1+1)))

And that would follow PEMDAS since the innermost blocks/parentheses are calculated first.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.