delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/23/08:45:30

From: Stephen Snape <stephen DOT snape AT virgin DOT net>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: double trouble
Date: Sat, 22 Aug 1998 16:30:35 +0000
Organization: Virgin News Service
Lines: 26
Message-ID: <35DEF229.8A4A71FC@virgin.net>
References: <35DEDC2F DOT BB81D366 AT virgin DOT net> <6rmjlm$oao$1 AT news DOT luth DOT se>
Reply-To: stephen DOT snape AT virgin DOT net
NNTP-Posting-Host: 194.168.70.37
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

yes, sorry, this isn't my actual code, I wrote it in the mail quickly, I
know I forgot the semis etc. What I am trying to do is find out if a 'bit'
in a double is ON or OFF and return the value. So I am using the int to
shift through the double and return the value, but I am getting errors. I
don't want to use a long because I need 64 bits!

Steve

Martin Str|mberg wrote:

> 1. Semi-colons omitted.
>
> 2. void return type but you still return something.
>
> 3. What do you really want to happen? If it was a float you could do
>    some ugly casting (something like *(int *)(&var)), but IIRC,
>    double's size doesn't match long or long long this wont work too
>    good. So some additional code would be necessay. Anyway the result
>    is almost meaningless.
>
> Cocteau Twins, Blue Bell Knoll,
>
>                                                         MartinS



- Raw text -


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