double vs single precision

Frank Adams franka at mmintl.UUCP
Tue Jan 14 21:23:05 AEST 1986


In article <1020 at turtlevax.UUCP> ken at turtlevax.UUCP (Ken Turkowski) writes:
>Just because it agrees with K&R doesn't make it right.  Nearly every
>other programming language states that if you want computations to be
>done at higher precision than any of the operands, then you cast any
>one of them to the higher precision.
>
>This should be done for chars and shorts as well as floats and longs.
>(could cast a long to double for more precision, but not to float)
>
>What's that?  You say it breaks existing code?  The easy solution to
>that is:
>
>#define char	long
>#define short	long
>#define int	long
>#define float	double

This will break a lot more existing code than eliminating the automatic
extension of floats, chars, and shorts will.

Frank Adams                           ihpn4!philabs!pwa-b!mmintl!franka
Multimate International    52 Oakland Ave North    E. Hartford, CT 06108



More information about the Comp.lang.c mailing list