Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 Pyramid OSx-3.0 85/11/15; site pyramid.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!decwrl!pyramid!wendyt From: wendyt@pyramid.UUCP (Wendy Thrash) Newsgroups: net.unix-wizards Subject: Re: Unsigned -> float conversion Message-ID: <255@pyramid.UUCP> Date: Mon, 7-Apr-86 17:45:07 EST Article-I.D.: pyramid.255 Posted: Mon Apr 7 17:45:07 1986 Date-Received: Wed, 9-Apr-86 23:46:02 EST References: <144@daisy.warwick.UUCP> Reply-To: wendyt@pyramid.UUCP (Wendy Thrash) Lines: 23 Summary: Looks familiar In article <144@daisy.warwick.UUCP> cudcv@daisy.warwk.ac.uk (Rob McMahon) writes >Pointed out to me by someone here - what does your favourite C compiler make >of this program : >[program involving conversion of large unsigned to float/double] A few months ago I posted a similar (but much larger) program to net.lang.c. (My address at that time was ...pyramid!isieng!wendyt, for you greppers.) Several people posted followups, others sent me mail, and I eventually summarized to the net. If you're interested in this problem you might want to check your news archives, but to summarize briefly, Vaxen running System V tend to do things right; just about everyone else messes up something (including the compiler I was working on at the time). This problem arises because hardware usually provides instructions to convert float/double to/from int, but never seems to provide instructions for unsigned conversion. Doing the unsigned conversions correctly is a real pain in the bazooka for a compiler writer, so s/he tends to take an "Oh well, who'd want to do this anyway?" approach. This is, of course, very bad form. But say, folks, when you see something like this on the net and find it to produce bizarre results on your hardware, please send a note off to the manufacturer! Believe it or not, not all hardware makers read the news; perhaps some who don't still read their bug reports.