From owner-freebsd-questions Wed Mar 17 5:16:13 1999 Delivered-To: freebsd-questions@freebsd.org Received: from mailout06.btx.dtag.de (mailout06.btx.dtag.de [194.25.2.154]) by hub.freebsd.org (Postfix) with SMTP id 029EB15122 for ; Wed, 17 Mar 1999 05:16:10 -0800 (PST) (envelope-from spinner.rflab@t-online.de) Received: from fwd03.btx.dtag.de (fwd03.btx.dtag.de [194.25.2.163]) by mailout06.btx.dtag.de with smtp id 10NG6g-00043q-00; Wed, 17 Mar 1999 14:11:34 +0100 Received: from www (089126010-0002(btxid)@[62.156.3.83]) by fwd03.btx.dtag.de with smtp id ; Wed, 17 Mar 1999 14:11:25 +0100 Message-ID: <36EFA9ED.5126E95C@t-online.de> Date: Wed, 17 Mar 1999 13:11:09 +0000 X-Mailer: Mozilla 3.01Gold (X11; I; Linux 2.0.34 i586) MIME-Version: 1.0 To: freebsd-questions@freebsd.org Subject: gnu C compiler Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Sender: 089126010-0002@t-online.de From: spinner.rflab@t-online.de (Steffen Hein) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dear Friends, How can you explain me that the same gnu C compiler ( release 2.7.2.1 ) in FreeBSD apparently does not handle the long double format correctly while in Linux it does ? Compiling the following program 'proto.c' in FreeBSD and in Linux as # cc -ansi proto.c -o proto.a and running proto.a in the two systems yields the displayed outputs /*********************************************************************** C program proto.c ***********************************************************************/ # define _POSIX_SOURCE # include # include # include # include # include # include # include # include # include # include main( ) { printf( "\n\n Ranges : " ); printf( "\n\n FLT_MIN = % le ", FLT_MIN); printf( "\n FLT_MAX = % le ", FLT_MAX ); printf( "\n DBL_MIN = % le ", DBL_MIN ); printf( "\n DBL_MAX = % le ", DBL_MAX ); printf( "\n LDBL_MIN = % Le ", LDBL_MIN ); printf( "\n LDBL_MAX = % Le ", LDBL_MAX ); printf( "\n\n Epsilon : " ); printf( "\n\n FLT_EPSILON = % le ", FLT_EPSILON ); printf( "\n DBL_EPSILON = % le ", DBL_EPSILON ); printf( "\n LDBL_EPSILON = % Le ", LDBL_EPSILON ); printf( "\n\n Precision : " ); printf( "\n\n FLT_DIG = % d ", FLT_DIG ); printf( "\n DBL_DIG = % d ", DBL_DIG ); printf( "\n LDBL_DIG = % d ", LDBL_DIG ); printf( "\n\n End " ); exit(NULL); } ======================================================================== FreeBSD output: Linux output: Ranges : FLT_MIN = 1.175494e-38 FLT_MAX = 3.402823e+38 DBL_MIN = 2.225074e-308 DBL_MAX = 1.797693e+308 LDBL_MIN = 3.362103e-4932 LDBL_MAX = 1.189731e+4932 Epsilon : FLT_EPSILON = 1.192093e-07 DBL_EPSILON = 2.220446e-16 LDBL_EPSILON = 1.084202e-19 Precision : FLT_DIG = 6 DBL_DIG = 15 LDBL_DIG = 18 End # Ranges : FLT_MIN = 1.175494e-38 FLT_MAX = 3.402823e+38 DBL_MIN = 2.225074e-308 DBL_MAX = 1.797693e+308 Floating point exception - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message