From owner-freebsd-hackers Sat Jul 14 11:20: 9 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from smtp.bmi.net (smtp.bmi.net [204.57.191.31]) by hub.freebsd.org (Postfix) with ESMTP id 793D937B401 for ; Sat, 14 Jul 2001 11:20:02 -0700 (PDT) (envelope-from jmcoopr@webmail.bmi.net) Received: from warp-borg (dsl-154.bmi.net [207.173.60.230]) by smtp.bmi.net (Pro-8.9.3/Pro-8.9.3) with SMTP id LAA06370; Sat, 14 Jul 2001 11:19:26 -0700 From: jmcoopr@webmail.bmi.net Message-Id: <200107141819.LAA06370@smtp.bmi.net> Date: Sat, 14 Jul 2001 11:17:40 -0700 To: Jim.Pirzyk@disney.com, freebsd-hackers@FreeBSD.ORG In-Reply-To: <200107141809.f6EI9M809946@snoopy.fan.fa.disney.com> Subject: Re: math library difference between linux emulation and native freebsd (and native linux) X-Mailer: MR/2 Internet Cruiser Edition for OS/2 v2.28a/28 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In <200107141809.f6EI9M809946@snoopy.fan.fa.disney.com>, on 07/14/2001 at 11:09 AM, Jim.Pirzyk@disney.com said: >So I have stumbled across a linux emulation bug in freebsd. Below is >the program that returns different results based on FreeBSD, Linux or >Linux emulation under FreeBSD. >Running natively under FreeBSD: >x = 53.27850000 >exp(x) = 137581029243568449912832.00000000 >Running natively under Linux: >x = 53.278500 >exp(x) = 137581029243568449912832.000000 >Running under FreeBSD in Linux emulation mode: >x = 53.27850000 >exp(x) = 137581029243567812378624.00000000 >#include >#include >#include >int main (int argc, char **argv) { > double x = 53.278500; > printf ("x = %8lf\n", x); > printf ("exp(x) = %8lf\n", exp(x)); > exit (0); >} >There are only two shared libaries in common (libc and libm) and both >are the same on FreeBSD (in /compat/linux) and Linux. >So any ideas on where the program is going wrong? >- JimP My guess is difference between Linux emulation and "native" 's floating point formatting for printf. With the number of significant digits you're invoking, small differences in handling low order bits can be significant. jmc ------------------------------------------------------ jmcoopr@webmail.bmi.net Using OS/2 since 1.0 ------------------------------------------------------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message