[comp.sys.sun] SunOS 4.0.3's printf and -0

ado@ncifcrf.gov (Arthur David Olson) (08/20/89)

An interesting result from SunOS 4.0.3's printf (with a tip of the hat to
IEEE):

	Script started on Sat Aug 19 15:40:36 1989
	elsie$ cat try.c
	#include <stdio.h>

	main()
	{
		float	f, g, h, i;

		f = -1;
		g = 0;
		h = f * g;
		i = h;
		(void) printf("%g %g\n", h, i);
		if (i == 0)
			i = 0;
		(void) printf("%g %g\n", h, i);
		return 0;
	}
	elsie$ cc try.c
	elsie$ a.out
	-0 -0
	-0 0
	elsie$ exit

	script done on Sat Aug 19 15:40:52 1989
-- 
	Arthur David Olson    ado@alw.nih.gov    ADO is a trademark of Ampex.