Re: Strange calculation problem

2009-08-26 Thread Tom S
bearophile wrote: Lars T. Kyllingstad: I think the compiler should be smart enough to figure this out for itself, but until that happens you can work around it by suffixing at least one of the integer literals with LU, so the compiler interprets the entire expression as an ulong: To make

Re: Strange calculation problem

2009-08-26 Thread bearophile
Steven Schveighoffer: This is not a bug, and will probably not be changed (it's been this way since C). It is impossible for the compiler to know whether you wanted sign extension or not, as some code depends on sign extension. I'd like overflow errors bot at compile and run-time, to

Re: Strange calculation problem

2009-08-25 Thread bearophile
Lars T. Kyllingstad: I think the compiler should be smart enough to figure this out for itself, but until that happens you can work around it by suffixing at least one of the integer literals with LU, so the compiler interprets the entire expression as an ulong: To make this fix happen

Re: Strange calculation problem

2009-08-25 Thread grauzone
bearophile wrote: Lars T. Kyllingstad: I think the compiler should be smart enough to figure this out for itself, but until that happens you can work around it by suffixing at least one of the integer literals with LU, so the compiler interprets the entire expression as an ulong: To make