From owner-freebsd-questions Mon Aug 19 9:18:28 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F5F237B400 for ; Mon, 19 Aug 2002 09:18:24 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E60E43E6E for ; Mon, 19 Aug 2002 09:18:23 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.5/8.12.5) id g7JGIJ3e067899; Mon, 19 Aug 2002 11:18:19 -0500 (CDT) (envelope-from dan) Date: Mon, 19 Aug 2002 11:18:19 -0500 From: Dan Nelson To: Mikhail Teterin Cc: Matthew Seaman , questions@FreeBSD.ORG Subject: Re: pow(3) on FreeBSD Message-ID: <20020819161819.GB70455@dan.emsphone.com> References: <200208190413.g7J4DEcw051123@corbulon.video-collage.com> <20020819043012.GN74231@dan.emsphone.com> <200208191124.35129.mi+mx@aldan.algebra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200208191124.35129.mi+mx@aldan.algebra.com> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Aug 19), Mikhail Teterin said: > You are right, the FreeBSD's man-page does not specify the return value > in case of a non-integer y. I just know it from experiment to be zero > (and not NaN as Matthew claimed). > > = $ cat > test.c > = #include > = #include > = main() > = { > = printf("%f\n", pow(2, 1.5)); > = } > = ^D > = $ gcc test.c -lm > = $ ./a.out > = 2.828427 > > The test above was, obviously, done on Solaris. On FreeBSD, this same > program outputs zero: > > mteterin@misha:~ (257) uname -a > FreeBSD misha 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed Jul 31 13:27:39 EDT > 2002 mteterin@misha [...] > mteterin@misha:~ (258) ./a.out > 0.000000 There must be something wrong with your setup, then :) It prints 2.828427 on my -current box and all my 4.* boxes as well. Try rebuilding libc and libm with CFLAGS=-O and nothing else. You may have hit a compiler bug. FreeBSD dan.emsphone.com 5.0-CURRENT FreeBSD 5.0-CURRENT #181: Thu Jul 25 14:15:12 CDT 2002 zsh@dan.emsphone.com:/usr/src/sys/i386/compile/DANSMP i386 -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message