[6020] in Athena Bugs

home help back first fref pref prev next nref lref last post

rt hc

daemon@ATHENA.MIT.EDU (ellis@ATHENA.MIT.EDU)
Thu Sep 13 11:59:42 1990

From: ellis@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Date: Thu, 13 Sep 90 11:58:20 EDT

System name:		soup
Type and version:	RT 7.1


What were you trying to do?
       assign an unsigned int (value 0x80000000) to float

What's wrong:
       the float value comes out negative.

What should have happened:
       the float should be positive

To duplicate:
       compile and run the following code on an RT. 
       the final printf will print out a negative number.

**********************************************************
#include <stdio.h>

main()
{
	unsigned int i,k;
        double a;
	i=2;
	do {
           k=i;
	   i<<=1;
           printf("%u %u \n",k,i);
	} while (i);
        a = k ;
        printf("%f \n",a);
}







home help back first fref pref prev next nref lref last post