Date: Thu, 9 Nov 2000 08:45:54 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Graham Reeds cc: djgpp AT delorie DOT com Subject: Re: Looking at the individual bits of a float. In-Reply-To: <6fqO5.60817$mv2.276178@news2-win.server.ntlworld.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 9 Nov 2000, Graham Reeds wrote: > I was wondering if anyone has any fast ways of looking at the individual > bits and bytes of a float with or without (preferably) destroying the float > in question. What's the problem, exactly? You don't destroy anything by examining the bits, e.g. with "(f & MASK)", where MASK is an appropriately set-up bit mask variable. If your problem is with double's (as opposed to float's), define a union of a double and two 32-bit unsigned int's, and do the bit fiddling on the int's.