From owner-freebsd-questions Wed Feb 12 18:50:35 2003 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 F1B1F37B401 for ; Wed, 12 Feb 2003 18:50:33 -0800 (PST) Received: from wrath.cs.utah.edu (wrath.cs.utah.edu [155.99.198.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5DACF43FDD for ; Wed, 12 Feb 2003 18:50:33 -0800 (PST) (envelope-from ppatel@cs.utah.edu) Received: from nfast.cs.utah.edu (nfast.cs.utah.edu [155.99.212.2]) by wrath.cs.utah.edu (8.11.6/8.11.6) with ESMTP id h1D2oND08899; Wed, 12 Feb 2003 19:50:23 -0700 (MST) Date: Wed, 12 Feb 2003 19:50:23 -0700 (MST) From: Parveen Patel X-X-Sender: ppatel@bas.flux.utah.edu To: Dan Nelson Cc: freebsd-questions@FreeBSD.ORG Subject: Re: floating point in the kernel In-Reply-To: <20030213001316.GD1980@dan.emsphone.com> Message-ID: <20030212194757.U25147-100000@bas.flux.utah.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Thanks for your response. My only concern is a square root operation I have to do. Is there some standard routine that will do it for long long or else I can pull out some code from gnu/i386/fpemul to do my computations. -Parveen. On Wed, 12 Feb 2003, Dan Nelson wrote: > In the last episode (Feb 12), Parveen Patel said: > > Can I use floating point operations inside the FreeBSD kernel version > > 4.7-stable? It used to be a policy not to use it for obvious > > performance probelms. > > You're not supposed to. I think this was the last time it was brought > up: > > http://groups.google.com/groups?threadm=746alr%24d44%241%40FreeBSD.csie.NCTU.edu.tw > > > Are there any known work arounds? Like some standard efficient > > techniques to convert floating point operations to fixed point > > operations without losing too much precision. > > Multiply your numbers by 10^9, store everything in long longs, and > write your own printf_fake_fp function that shifts the decimal point? > > -- > Dan Nelson > dnelson@allantgroup.com > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message