Article View: comp.lang.misc
Article #3943Re: Safety. Was: Re: Pointers
From: Herman Rubin
Date: Wed, 16 Dec 1992 17:39
Date: Wed, 16 Dec 1992 17:39
31 lines
1818 bytes
1818 bytes
In article <1992Dec16.164821.19079@walter.bellcore.com> dnew@thumper.bellcore.com (Darren New) writes:
.................
>> use_double(c,d)
>> where, for example, c and d would be 32-bit objects and double is 64-bit.
>This is a trivial modification, using a union with two 32-bit objects
>overlapping one 64-bit object.
>However, C cannot choose different functions based on that their value
>is returned as. What should it do if you say
>process(use_double(c,d))
>and you haven't declared what types "process" uses returns. It's a tiny
>amount of work to use different functions depending on what you want to
>pass and what you want back, compared to actually getting it to work.
My idea about "use" is much simpler. The expression use_double(...), as
I intend it, means that the bit pattern, or concatenated bit pattern,
described in the parentheses is to be now used as a double number in
any application. Therefore, in process(use_double(...)), process just
assumes that what is presented to it is a double, just as the cast to
double declares that the result is double.
--
Herman Rubin, Dept. of Statistics, Purdue Univ., West Lafayette IN47907-1399
Phone: (317)494-6054
hrubin@snap.stat.purdue.edu (Internet, bitnet)
{purdue,pur-ee}!snap.stat!hrubin(UUCP)
Technical Details
Message-ID:
<BzD525.Ayv@mentor.cc.purdue.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubinReferences:
<1992Dec16.164821.19079@walter.bellcore.com>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.misc Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!sample.eng.ohio-state.edu!purdue!mentor.cc.purdue.edu!pop.stat.purdue.edu!hrubin From: hrubin@pop.stat.purdue.edu (Herman Rubin) Subject: Re: Safety. Was: Re: Pointers Message-ID: <BzD525.Ayv@mentor.cc.purdue.edu> Sender: news@mentor.cc.purdue.edu (USENET News) Organization: Purdue University Statistics Department References: <1992Dec16.164821.19079@walter.bellcore.com> Date: Wed, 16 Dec 1992 17:39:40 GMT Lines: 31