From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 26 20:11:19 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D372E16A4CE for ; Wed, 26 Jan 2005 20:11:19 +0000 (GMT) Received: from mhultra.aero.org (mhultra.aero.org [130.221.88.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id A631543D48 for ; Wed, 26 Jan 2005 20:11:19 +0000 (GMT) (envelope-from cal@rushg.aero.org) Received: from rushe.aero.org ([130.221.24.10] [130.221.24.10]) by mhultra.aero.org with ESMTP; Wed, 26 Jan 2005 12:11:15 -0800 Received: from calamari.aero.org (calamari.aero.org [130.221.26.26]) by rushe.aero.org (8.11.7p1+Sun/8.11.7) with ESMTP id j0QKBEj29103; Wed, 26 Jan 2005 12:11:14 -0800 (PST) Received: from calamari.aero.org (localhost [127.0.0.1]) by calamari.aero.org (8.12.11/8.11.6) with ESMTP id j0QKArU6041943; Wed, 26 Jan 2005 12:10:53 -0800 (PST) (envelope-from cal@calamari.aero.org) Received: (from cal@localhost) by calamari.aero.org (8.12.11/8.12.11/Submit) id j0QKArWl041942; Wed, 26 Jan 2005 12:10:53 -0800 (PST) (envelope-from cal) Date: Wed, 26 Jan 2005 12:10:53 -0800 (PST) From: Chris Landauer Message-Id: <200501262010.j0QKArWl041942@calamari.aero.org> To: ambrisko@ambrisko.com X-Mailman-Approved-At: Thu, 27 Jan 2005 13:29:52 +0000 cc: freebsd-hackers@freebsd.org cc: cal@rush.aero.org Subject: bug in calcru() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2005 20:11:20 -0000 hihi, doug - thanx for the suggestion - the notion of computing ut just with subtraction is really good, since it is likely to be the largest of the three values in most applications, but i'm a little worried that the 1024 multiplications aren't large enough when tt gets really large - i'll do the math on it and report its (provable) range of applicability and accuracy in a few days more soon, cal Chris Landauer Aerospace Integration Science Center The Aerospace Corporation cal@aero.org > Doug Ambrisko wrote > ... > /* Subdivide tu. try to becareful of overflow */ > su = tu * (st * 1024 / tt) / 1024; > iu = tu * (it * 1024 / tt) / 1024; > uu = tu - (su + iu); > ...