From owner-freebsd-questions Mon Aug 19 9:10:48 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 20F2F37B431 for ; Mon, 19 Aug 2002 09:10:30 -0700 (PDT) Received: from mta01-srv.alltel.net (mta01.alltel.net [166.102.165.143]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6061B43E70 for ; Mon, 19 Aug 2002 09:10:28 -0700 (PDT) (envelope-from cd9@buffalo.edu) Received: from fork.alltel.net ([166.102.201.21]) by mta01-srv.alltel.net with ESMTP id <20020819161021.TQFC24024.mta01-srv.alltel.net@fork.alltel.net> for ; Mon, 19 Aug 2002 11:10:21 -0500 Received: from localhost ([127.0.0.1] helo=selvirjin.alltel.net) by fork.alltel.net with esmtp (Exim 3.36 #1) id 17gp6G-0008w1-00; Mon, 19 Aug 2002 12:09:52 -0400 Received: (from dragon@localhost) by selvirjin.alltel.net (8.12.3/8.12.3/Submit) id g7JG9gD2033899; Mon, 19 Aug 2002 12:09:42 -0400 (EDT) X-Authentication-Warning: selvirjin.alltel.net: dragon set sender to cd9@buffalo.edu using -f Date: Mon, 19 Aug 2002 12:09:42 -0400 From: "C. A. Daelhousen" To: Mikhail Teterin Cc: freebsd-questions@freebsd.org Subject: Re: pow(3) on FreeBSD Message-ID: <20020819120942.A65360@selvirjin.alltel.net> 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>; from mi+mx@aldan.algebra.com on Mon, Aug 19, 2002 at 11:24:35AM -0400 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 On Mon, Aug 19, 2002 at 11:24:35AM -0400, Mikhail Teterin wrote: > There is nothing complex (pun intended) about, say, 1^2.5. It is still > 1. -- unless you are running FreeBSD (Linux?)... There is nothing > complex about Dan's's example (2^1.5) above either -- the correct value > is 2.828427, but it is 0 on FreeBSD -- in accordance with the man-page > and in disagreement with Dan... > > Now, can someone, please, offer the REAL reasons for the FreeBSD's > apparent defficiency? May be, even a double-precision workaround -- > unlike powf(3), which operates on float-precision numbers?.. > It works for me. c/pow.c: #include #include int main() { printf("%e\n", pow(2,1.5)); return 0; } compile/run: $ gcc30 -O2 -march=athlon -pipe -o bin/pow -lm -Wall c/pow.c $ bin/pow 2.828427e+00 $ uname -a FreeBSD 4.6.2-RELEASE FreeBSD 4.6.2-RELEASE #0: Sun Aug 18 19:22:25 EDT 2002 root@:/usr/obj/usr/src/sys/V8 i386 -- ..: Chad Daelhousen == cd9@buffalo.edu :.........: sig v3.1 :... : Programming for 10 +/- 2 years (50 +/- 10% of a lifetime) : :.............Perl will be the first to implement mind reading.: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message