forum

Home / DeveloperSection / Forums / In C# integer arithmetic, does a/b/c always equal a/(b*c)?

In C# integer arithmetic, does a/b/c always equal a/(b*c)?

Takeshi Okada210806-Jun-2013
Hi Expert,

Let a, b and c be non-large positive integers. Does a/b/c always equal a/(b * c) with C# integer arithmetic? For me, in C# it looks like:

int a = 5126, b = 76, c = 14;
int x1 = a / b / c;
int x2 = a / (b * c);

So my question is: does x1 == x2 for all a, b and c?

Thanks in advance. 

Updated on 06-Jun-2013

Can you answer this question?


Answer

1 Answers

Liked By