🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #1286

SunOS 4.0.3's printf and -0

#1286
From: Arthur David Olson
Date: Sat, 19 Aug 1989 20:52
30 lines
988 bytes
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.
Technical Details
Message-ID: <1104@brazos.Rice.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!rice!sun-spots-request
From: elsie!ado@ncifcrf.gov (Arthur David Olson)
Newsgroups: comp.sys.sun
Subject: SunOS 4.0.3's printf and -0
Message-ID: <1104@brazos.Rice.edu>
Date: 19 Aug 89 20:52:24 GMT
Sender: root@rice.edu
Organization: Sun-Spots
Lines: 30
Keywords: SunOS
Approved: Sun-Spots@rice.edu
X-Sun-Spots-Digest: Volume 8, Issue 107, message 11 of 16