From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.redhat.com (mail.redhat.com [199.183.24.239]) by listman.redhat.com (Postfix) with ESMTP id DE9232FC5E for ; Thu, 28 Sep 2000 21:29:45 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id e8T1TjR07732 for axp-list@listman.redhat.com; Thu, 28 Sep 2000 21:29:45 -0400 Received: from voicenet.com (mail11.voicenet.com [207.103.0.37]) by mail.redhat.com (8.11.0/8.8.7) with SMTP id e8T1TiD07728 for ; Thu, 28 Sep 2000 21:29:44 -0400 Received: (qmail 16412 invoked from network); 29 Sep 2000 01:29:43 -0000 Received: from dialpool0529-pri.voicenet.com (HELO voicenet.com) (209.71.86.29) by mail11.voicenet.com with SMTP; 29 Sep 2000 01:29:43 -0000 Message-ID: <39D3E5FA.E6BB8539@voicenet.com> Date: Thu, 28 Sep 2000 19:44:42 -0500 From: Uncle George Organization: GatWorks X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.16 alpha) X-Accept-Language: en MIME-Version: 1.0 To: axp-list@redhat.com Subject: long->double->long goes negative Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0beta4 Precedence: bulk Reply-To: axp-list@redhat.com List-Id: Linux and Red Hat on Alpha processors What is wrong with this picture: Somehow I expected a positive number & a result like 0x7fffffffffffffffL Am I expecting too much: signed - floating point blues. results are: lb=9223372036854775807, db=(9.223372036854775808e+18, 43e0000000000000), la=-9223372036854775808 main() { long lb,la; double db,da; union { long q; double d; } u; lb =0x7fffffffffffffffL; db = (double) lb; la = (long) db; u.d = db; printf("lb=%ld, db=(%23.18e, %lx), la=%ld\n", lb, db,u.q, la); } cc -g -mieee a.c ./a.out