derived types

Henry Spencer henry at utzoo.UUCP
Wed Jan 30 10:06:51 AEST 1985


> > 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



More information about the Comp.lang.c mailing list