# Mathematical operations on multiple numbers

**URL:** <https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285>\
**Category:** Questions about Thunkable X\
**Created:** [May 10, 2024, 9:51pm UTC](https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285 "2024-05-10T21:51:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve\_synopsis](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@steve\_synopsis](https://community.thunkable.com/u/steve_synopsis)\
**Post date:** [May 10, 2024, 9:51pm UTC](https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285/1 "2024-05-10T21:51:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 11, 2024, 12:23am UTC](https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285/2 "2024-05-11T00:23:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tiny\_apps](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@tiny\_apps](https://community.thunkable.com/u/tiny_apps)\
**Post date:** [May 11, 2024, 12:16pm UTC](https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285/3 "2024-05-11T12:16:44Z")

</div>

Use blocks inside the block… like this

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/5/e5fca188b2bf20518bbf9e39d3d681903d3b91f3.png)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 11, 2024, 6:02pm UTC](https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285/4 "2024-05-11T18:02:20Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/0/80a05f00977f923d2609868a5fb2cf49fb66a0cd.png)

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.

---

<div class="post-metadata">

**Author:** ![steve\_synopsis](https://avatars.discourse-cdn.com/v4/letter/s/48db29/32.png) [@steve\_synopsis](https://community.thunkable.com/u/steve_synopsis)\
**Post date:** [May 13, 2024, 6:20pm UTC](https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285/5 "2024-05-13T18:20:25Z")

</div>

Will try this. Thanks.

Question is, does this follow PEDMAS principles.

---

<div class="post-metadata">

**Author:** ![tiny\_apps](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@tiny\_apps](https://community.thunkable.com/u/tiny_apps)\
**Post date:** [May 13, 2024, 6:32pm UTC](https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285/6 "2024-05-13T18:32:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 13, 2024, 8:55pm UTC](https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285/7 "2024-05-13T20:55:29Z")

</div>

> [@tiny\_apps](#):
>
> consider each block as a bracket

Yes, that’s good advice. So this:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/5/e5fca188b2bf20518bbf9e39d3d681903d3b91f3.png)

would be the same as this:

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

And that would follow [PEMDAS](https://www.mathsisfun.com/operation-order-pemdas.html) since the innermost blocks/parentheses are calculated first.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [August 11, 2024, 8:56pm UTC](https://community.thunkable.com/t/mathematical-operations-on-multiple-numbers/2996285/8 "2024-08-11T20:56:04Z")

</div>

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