#what

1 messages · Page 1 of 1 (latest)

remote radish
#
int add(int a, int b) {
    int max = 2147483648;
    return max - ((max - a) - b);
}
unborn lake
#

max could be anything, this is just doing max - max + a + b

unborn lake
#

well I mean that you can set max to whatever, the underlying math is just max-max+a+b which is just a+b

remote radish
#

and the max is the signed int maximum

unborn lake
#

Bruh

#

Don't drop math it's important

#

What is substraction but the addition of the opposite

exotic marten
#

this is why learn math

frosty forum
#

Yup learn math man,
Max-((max-a)-b)

Max-(max-a-b)
Max-max+a+b
(Max-max)+(a+b)
(0)+(a+b)
Just, (a+b)

wicked juniper
#

And if u are surprised by -(-x)=x perhaps u should go back to kindergarten

remote radish
wicked juniper
#

How old are u

remote radish
remote radish