[comp.bugs.sys5] using "cb" causes problems with floating-point numbers

mike@vort.uucp (Mike Nemeth) (12/11/90)

% cat a.c
#include <stdio.h>
main() { float a; a = 10e-3; printf("a = %f\n", a); }
% cc -o a a.c
% ./a
a = 0.010000
% cb -s < a.c > b.c
% cat b.c
#include <stdio.h>
main()
{
	float a;

	a = 10e - 3;	/* <--- !!! */
	printf("a = %f\n", a);
}
% cc -o b b.c
% ./b
a = 7.000000
%

-- 
On the advice of council, I must respectfully decline to confirm any
of the above. Perhaps it was a glitch. Perhaps you are hallucinating.
   >-> Mike Nemeth     Vort Computing   ...calgary!vort!mike <-<

hansen@pegasus.att.com (Tony L. Hansen) (12/14/90)

< % cat a.c
< #include <stdio.h>
< main() { float a; a = 10e-3; printf("a = %f\n", a); }
< % cb -s < a.c
< #include <stdio.h>
< main()
< {
< 	float a;
< 
< 	a = 10e - 3;	/* <--- !!! */
< 	printf("a = %f\n", a);
< }

This problem has been fixed in System V release 4.

					Tony Hansen
				att!pegasus!hansen, attmail!tony
				    hansen@pegasus.att.com

suitti@ima.isc.com (Stephen Uitti) (12/20/90)

In article <1990Dec13.193610.25629@cbnewsk.att.com> hansen@pegasus.att.com (Tony L. Hansen) writes:
>< % cat a.c
>< #include <stdio.h>
>< main() { float a; a = 10e-3; printf("a = %f\n", a); }
>< % cb -s < a.c
>< #include <stdio.h>
>< main()
>< {
>< 	float a;
>< 
>< 	a = 10e - 3;	/* <--- !!! */
>< 	printf("a = %f\n", a);
>< }
>
>This problem has been fixed in System V release 4.

This problem does not appear in Interactive UNIX for 386/486
systems.  This is a System V release 3.2 based system.  The
original Sys V 3.2 code does not appear to have this bug.

Stephen.
suitti@ima.isc.com

guy@auspex.auspex.com (Guy Harris) (01/05/91)

 >This problem does not appear in Interactive UNIX for 386/486
 >systems.  This is a System V release 3.2 based system.  The
 >original Sys V 3.2 code does not appear to have this bug.

The SVR3.1 code (at least the 3B2 source version) *does* have the bug,
for what it's worth.