delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/28/23:25:15

From: "Campbell, Rolf [SKY:1U32:EXCH]" <cp1v45 AT americasm01 DOT nt DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Forming a float from 4 seperate bytes
Date: Wed, 28 Jul 1999 14:11:29 -0400
Organization: Nortel Networks
Lines: 15
Message-ID: <379F47D1.D433939D@americasm01.nt.com>
References: <7nku8s$hkl$1 AT nnrp1 DOT deja DOT com> <sepn3.1415$lp DOT 28209 AT stones>
NNTP-Posting-Host: bmerhc00.ca.nortel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.7 [en] (X11; I; HP-UX B.10.20 9000/712)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Ian Miller wrote:

> union both
> {int i, float f} u;

    You could also do:
union {char ch[4]; float f;} u;

Then you wouldn't have to do any shifting or OR'ing.

--
     -Rolf Campbell (39)3-6318



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019