Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug report - incorrect sign when using long long variables

0 views
Skip to first unread message

Colin Barker

unread,
Jun 21, 2009, 8:59:28 AM6/21/09
to
I reported a bug for this program some time ago. The value printed for x was
incorrect. With the version of lcc-win32 that I downloaded yesterday, the
absolute values of x and t-4b are now both correct, but they are both
incorrectly considered to be negative!

#include <stdio.h>
int main(void)
{
long long t=15528312597606, b=1762289, x;
x=t-4*b;
(void)printf("x=%lld t-4b=%lld\n", x, t-4*b);
return 1;
}

--
Colin

jacob navia

unread,
Jun 22, 2009, 4:42:25 PM6/22/09
to

This is HIGHLY embarrassing :-(

Please download again. I fixed this on Sunday

jacob

CBFalconer

unread,
Jun 22, 2009, 7:30:09 PM6/22/09
to
jacob navia wrote:
> Colin Barker wrote:
>
>> I reported a bug for this program some time ago. The value
>> printed for x was incorrect. With the version of lcc-win32 that
>> I downloaded yesterday, the absolute values of x and t-4b are
>> now both correct, but they are both incorrectly considered to
>> be negative!
>>
>> #include <stdio.h>
>> int main(void) {
>> long long t=15528312597606, b=1762289, x;
>> x=t-4*b;
>> (void)printf("x=%lld t-4b=%lld\n", x, t-4*b);
>> return 1;
>> }
>
> This is HIGHLY embarrassing :-(
>
> Please download again. I fixed this on Sunday

Maintenance of your release testing program will avoid these
problems.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.

0 new messages