From owner-freebsd-hackers Sat Jul 14 11:28: 9 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.disney.com (mail.disney.com [204.128.192.15]) by hub.freebsd.org (Postfix) with ESMTP id CECEC37B401 for ; Sat, 14 Jul 2001 11:28:04 -0700 (PDT) (envelope-from Jim.Pirzyk@disney.com) Received: from pain10.corp.disney.com (root@pain10.corp.disney.com [153.7.110.100]) by mail.disney.com (Switch-2.0.1/Switch-2.0.1) with SMTP id f6EIRII15994 for ; Sat, 14 Jul 2001 11:27:18 -0700 (PDT) Received: from [172.30.50.1] by pain.corp.disney.com with ESMTP for freebsd-hackers@FreeBSD.ORG; Sat, 14 Jul 2001 11:28:58 -0700 Received: from plio.fan.fa.disney.com (plio.fan.fa.disney.com [153.7.118.2]) by pecos.fa.disney.com (8.11.3/8.11.3) with ESMTP id f6EIS3s14357 for ; Sat, 14 Jul 2001 11:28:03 -0700 (PDT) Received: from mercury.fan.fa.disney.com (mercury.fan.fa.disney.com [153.7.119.1]) by plio.fan.fa.disney.com (8.9.2/8.9.2) with ESMTP id LAA17399 for ; Sat, 14 Jul 2001 11:28:02 -0700 (PDT) (envelope-from Jim.Pirzyk@disney.com) Received: from [172.30.46.50] by mercury.fan.fa.disney.com with ESMTP; Sat, 14 Jul 2001 11:28:01 -0700 Date: Sat, 14 Jul 2001 11:28:03 -0700 From: Jim Pirzyk Content-Type: text/plain; format=flowed; charset=us-ascii Subject: Re: math library difference between linux emulation and native freebsd (and native linux) Cc: freebsd-hackers@FreeBSD.ORG To: jmcoopr@webmail.bmi.net X-Mailer: Apple Mail (2.388) In-Reply-To: <200107141819.LAA06370@smtp.bmi.net> Mime-Version: 1.0 (Apple Message framework v388) Content-Transfer-Encoding: 7bit Message-Id: 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 On Saturday, July 14, 2001, at 11:17 AM, jmcoopr@webmail.bmi.net wrote: > 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. So I tried writing it out with write directly and did a binary compare, they still are different. :( - JimP To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message