possible loss of precision-with mod- (but it's not)
问题 So this the line with the precision error fault; A[i]= m % 3; m is long A is int[]; And my error is error: possible loss of precision A[i]= m % 3. required int found long. How can I have error when the only potential answers are 0,1,2? Isn't there another way than declaring A as long[]? It's a potentially big array so I don't want that (in fact I would even prefer for A to be short[]) Also I tried error: A[i]= m % 3L , but same result. 回答1: The compiler doesn't look at the result, it looks at