Hello there, this is my first post here, I hope this is the right place to post this question.

Situation 1:

long a = 5000000;

long b = 5000000;

long c = a + b;

Situation 2:

long a = 5;

long b = 5;

long c = a + b;

My question is: which one is calculated faster, situation 1 or 2?

Situation 1:

long a = 5000000;

long b = 5000000;

long c = a + b;

Situation 2:

long a = 5;

long b = 5;

long c = a + b;

My question is: which one is calculated faster, situation 1 or 2?

Ya that's what I thought (I just needed someone who knows a lot about C++ to confirm it). Thank you very much.

situation 2, not that it matters, the difference is a nanosecond of computing power >.>

Last edited on

Why would it be faster?

Which of these is faster to compute?

#1

00000000000000000000000000000001

AND

00000000000000000000000000000010

#2

11111111111111110000000000000000

AND

00000000000000001111111111111111

Which of these is faster to compute?

#1

00000000000000000000000000000001

AND

00000000000000000000000000000010

#2

11111111111111110000000000000000

AND

00000000000000001111111111111111

Topic archived. No new replies allowed.