[net.bugs] awk accepts but blows unary negation

geoff@desint.UUCP (Geoff Kuenning) (03/16/86)

Talk about confusing me!  Try this one on your system:

	echo 15 | awk '{t1=-15;t2=15;t3=-t2;t4=-$1;print t1,t3,t4}'

On my system (Unisoft V.0) it produces:

	-2.71875 -2.71875 -2.71875

The expression "t1=0-15" works correctly.
-- 

	Geoff Kuenning
	{hplabs,ihnp4}!trwrb!desint!geoff

david@ztivax.UUCP (03/18/86)

>echo 15 | awk '{t1=-15;t2=15;t3=-t2;t4=-$1;print t1,t3,t4}'

On my system (Unisoft V.0) it produces:

	-2.71875 -2.71875 -2.71875

On my system (4.2bsd)  works perfectly.  yaub (yet another unisoft
bug).

By the way, does your file system only last about a month like on my
last Unisoft system?  (last because I won't try Unisoft again after 2
years of intense headaches)  Noone ever could solve that one, but I
think it was because they could not properly handle fragmentation in
the file system.

real men use real UNIX

seismo!unido!ztivax!david

steve@jplgodo.UUCP (Steve Schlaifer x3171 156/224) (03/18/86)

In article <179@desint.UUCP>, geoff@desint.UUCP (Geoff Kuenning) writes:
> Talk about confusing me!  Try this one on your system:
> 
> 	echo 15 | awk '{t1=-15;t2=15;t3=-t2;t4=-$1;print t1,t3,t4}'
> 
> On my system (Unisoft V.0) it produces:
> 
> 	-2.71875 -2.71875 -2.71875
> 
> The expression "t1=0-15" works correctly.

On my Ridge 32C running ROS 3.3, I get -15 -15 -15.  Looks like you have a bug.
-- 

...smeagol\			Steve Schlaifer
......wlbr->!jplgodo!steve	Advance Projects Group, Jet Propulsion Labs
....group3/			4800 Oak Grove Drive, M/S 156/204
				Pasadena, California, 91109
					+1 818 354 3171