List.Reduce explaination

Can someone please explain me List.Reduce ? Not sure if my calculation (see annotation) makes sense, expecially with “-” and “/”

Hi Thomas

The first image:

(+) : 3+1+2+3=9
(-): 3-1-2-3=-1
(*): 3*1*2*3=18
(/):3/1/2/3=0.5

Seed is the starting number, and then each element in the list is reduced by the reductor.

thank you Einar, but how do u calculate 3-1-2-3?? for me the result should be -3 ?

Yes that’s strange , maybe negative values becomes -1 as in out of range

Maybe it’s reduced from last to first:
(+) : 3+2+1+3=9
(-): 1-2-3+3=-1
(): 3213=18
(/):3/2/1/3=0.5

1 Like

ok, the sorting is reversed, and the seed is at the end. With that logic the 2nd screen should be: 1-2-3-4+2=-6 but it is 4 ? :stuck_out_tongue: I don’t get it

It must be like this:-(-(-(-3)-2)-1)-3 = -1

1 Like

a=-4
b=-a-3=-(-4)-3=1
c=-b-2=-(+1)-2=-3
d=-c-1=-(-3)-1=2
e=-d-2=-(+2)-2=-4

I think we are close :slight_smile: but -4 is not 4

Reductor: -
Seed: 3
List: {1,2,3}

1-3=-2
2-(-2)=4
3-4=-1

Seems to do what it says…

2 Likes

Thank you Vikram!

The concat example: (reductor: conat, seed: f, list a…d)
a+f=af
b+af=baf
c+baf=cbaf
d+cbaf=dcbaf

1 Like

reductor: -
seed: 2
List: {1,2,3,4}

a=listItem1 - Seed
b=listitem2 - a
c=listitem3 - b
d=listitem4 - c

1-2=-1
2-(-1)=3
3-3=0
4+0=4

Thanks Vikram, got it :smiley: