i = i * f vs. i *= f

ado at elsie.UUCP ado at elsie.UUCP
Fri Apr 13 00:45:51 AEST 1984


I compiled the following program with the 4.1bsd C compiler:
	main()
	{
		int	i;

		i = 100;
		i = i * .2;
		printf("%d\n", i);
		i = 100;
		i *= .2;
		printf("%d\n", i);
	}

I got this output:
	20
	0

Is this a bug?
-- 
UUCP:	decvax!harpo!seismo!rlgvax!cvl!elsie!ado
DDD:	(301) 496-5688



More information about the Comp.lang.c mailing list