Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: derived types Message-ID: <4987@utzoo.UUCP> Date: Tue, 29-Jan-85 19:06:51 EST Article-I.D.: utzoo.4987 Posted: Tue Jan 29 19:06:51 1985 Date-Received: Tue, 29-Jan-85 19:06:51 EST References: <7479@brl-tgr.ARPA> <37@gitpyr.UUCP>, <6873@watdaisy.UUCP> Organization: U of Toronto Zoology Lines: 24 > > If I were to adapt C to the 170 series, I would set the following types: > > > > float 60-bits > > double 60-bits > > Don't you dare. Double doesn't have to be exactly twice a float, but there > has to be enough to assist numerical calculations in certain kinds of error > determinations. Sorry, even tired old K&R says (section 4): Single-precision floating point (float) and double-precision floating-point (double) may be synonymous in some implementations. This really is inevitable on machines that don't gracefully support a short floating-point type. Making float == double really is the right thing to do when the shortest floating-point type is adequate for normal use, i.e. 64 bits or thereabouts. Making double a longer type generally means a severe speed penalty for all arithmetic, unless the compiler is new enough to take advantage of the ANSI draft's permissive language on this point. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry