From owner-freebsd-questions Thu Dec 29 21:08:38 1994 Return-Path: questions-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id VAA12241 for questions-outgoing; Thu, 29 Dec 1994 21:08:38 -0800 Received: from reggae.ncren.net (reggae.ncren.net [128.109.131.3]) by freefall.cdrom.com (8.6.9/8.6.6) with ESMTP id VAA12235 for ; Thu, 29 Dec 1994 21:08:37 -0800 Received: from ponds.UUCP by reggae.ncren.net (5.65/tas-reggae/may94) id AA18928; Fri, 30 Dec 94 00:08:02 -0500 Received: (rivers@localhost) by ponds.UUCP (8.6.9/8.6.5) id VAA19033; Thu, 29 Dec 1994 21:33:21 -0500 Date: Thu, 29 Dec 1994 21:33:21 -0500 From: Thomas David Rivers Message-Id: <199412300233.VAA19033@ponds.UUCP> To: freebsd-questions@freebsd.org, markd@grizzly.com Subject: Re: Behavior of sqrt on errors. Sender: questions-owner@freebsd.org Precedence: bulk > > > On FreeBSD, > > sqrt (-3.0); > > generates a SIGFPE. On all other systems I have encountered, it calls > matherr with a DOMAIN error. Can anyone more knowledgeable about the > ANSI standard comment if this correct ANSI behavior or a bug? > > Thanks, > Mark > From the sqrt(3) man page: The sqrt() function returns the requested square root unless an error occurs. On the VAX or Tahoe processor an attempt to take the sqrt() of negative x causes an er- ror; in this event, the global variable errno is set to EDOM and a re- served operand fault is generated. So, the man page implies this is working as designed. - Dave Rivers -