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 D0C402F182 for ; Fri, 29 Sep 2000 03:51:02 -0400 (EDT) Received: (from mail@localhost) by mail.redhat.com (8.11.0/8.8.7) id e8T7p2V10194 for axp-list@listman.redhat.com; Fri, 29 Sep 2000 03:51:02 -0400 Received: from c012.sfo.cp.net (c012-h015.c012.sfo.cp.net [209.228.13.219]) by mail.redhat.com (8.11.0/8.8.7) with SMTP id e8T7p2D10186 for ; Fri, 29 Sep 2000 03:51:02 -0400 Received: (cpmta 15706 invoked from network); 29 Sep 2000 00:49:45 -0700 Date: 29 Sep 2000 00:49:45 -0700 Message-ID: <20000929074945.15705.cpmta@c012.sfo.cp.net> X-Sent: 29 Sep 2000 07:49:45 GMT Received: from [62.236.152.55] by mail.altavista.com with HTTP; 29 Sep 2000 00:49:45 PDT Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 To: axp-list@redhat.com From: Phil Carmody X-Mailer: Web Mail 3.8.0.10 Subject: Re: long->double->long goes negative 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 The correct answer is of course "Scott Nudds flies out of your nose" (comp.lang.c.moderated and comp.lang.asm.x86 reference frm years back) <<< An rvalue of a floating point type can be converted to an rvalue of an integer type. The conversion truncates; that is, the fractional part is discarded. The behavior is undefined if the truncated value cannot be represented in the destination type. >>> _Undefined_ behaviour means that electrocuting the user is one of the other options. Just don't do it. If it formatted your hard disk that's because you invoked undefined behaviour. Phil (with language lawyer hat on) > > lb =0x7fffffffffffffffL; > > db = (double) lb; > > la = (long) db; Judge Lewis Kaplan's idiocy finally proved August 17, 2000: "Defendants, on the other hand, are adherents of a movement that believes that information should be available without charge to anyone clever enough to break into the computer systems or data storage media in which it is located." _______________________________________________________________________ Free Unlimited Internet Access! Try it now! http://www.zdnet.com/downloads/altavista/index.html _______________________________________________________________________