bug in hypot(3M)

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Sat Jul 7 04:48:56 AEST 1984


There is a bug in the hypot(3M) routine in UNIX System V Release
1.0, in that arguments of (0.0, 0.0) cause a divide-by-zero error.
I do not know whether this has been fixed in later releases.
The following editing transcript shows how to fix the bug:

ed - hypot.c
1
/*	@(#)hypot.c	1.6	*/
/\/=/i
	if ( b == 0.0 )				/* DAG -- bug fix */
		return 0.0;			/* DAG */
.
w
q



More information about the Net.bugs.usg mailing list