From: Phil Carmody <fatphil@altavista.com>
To: axp-list@redhat.com
Subject: Re: long->double->long goes negative
Date: 29 Sep 2000 00:49:45 -0700 [thread overview]
Message-ID: <20000929074945.15705.cpmta@c012.sfo.cp.net> (raw)
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
_______________________________________________________________________
next reply other threads:[~2000-09-29 7:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-09-29 7:49 Phil Carmody [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-09-29 16:36 long->double->long goes negative Brad Lucier
2000-09-29 11:58 Rick Gorton
2000-09-29 14:43 ` Uncle George
2000-09-29 0:44 Uncle George
2000-09-29 4:09 ` Brad Lucier
2000-09-29 9:41 ` Uncle George
2000-09-29 9:56 ` Dr. David Gilbert
2000-09-29 10:57 ` Uncle George
2000-09-29 11:55 ` Dr. David Gilbert
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox