delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/22/12:03:34

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:52:56 +0000
Organization: Virgin Net Usenet Service
Lines: 29
Message-ID: <35DEF766.61FDE0D7@virgin.net>
References: <35DEDC2F DOT BB81D366 AT virgin DOT net>
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

Hi,
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