Lattice versus CI86

Henry Spencer henry at utzoo.UUCP
Thu Jan 3 04:07:40 AEST 1985


> >   - Doesn't implement ++ and -- for float/double
> 
> While ++ and -- on float/double suggest they mean the same thing as
> {+-}= 1.0, some compilers object to this, with some justification.
> This is a non-portable construct. {+-}= 1.0 is clearer to read anyway.

It's more than just suggested.  K&R, section 7.2, says in so many words
that "++x" is equivalent to "x+=1".  There is nothing ill-defined or
implementation-dependent about the semantics of the latter, even when
applied to floating-point.  "--x", "x++", and "x--" are defined with
reference to "++x".  A compiler which does not implement the ++ and --
operators on floating-point operands is wrong, period.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list