Click here to Skip to main content
15,887,442 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Question about double #INF and #NAN Pin
CPallini27-Nov-09 5:54
mveCPallini27-Nov-09 5:54 
AnswerRe: Question about double #INF and #NAN Pin
Jeff Archer27-Nov-09 7:08
Jeff Archer27-Nov-09 7:08 
GeneralRe: Question about double #INF and #NAN Pin
Richard MacCutchan27-Nov-09 7:17
mveRichard MacCutchan27-Nov-09 7:17 
GeneralRe: Question about double #INF and #NAN Pin
Jeff Archer27-Nov-09 7:51
Jeff Archer27-Nov-09 7:51 
GeneralRe: Question about double #INF and #NAN Pin
CPallini27-Nov-09 7:23
mveCPallini27-Nov-09 7:23 
GeneralRe: Question about double #INF and #NAN Pin
Jeff Archer27-Nov-09 7:50
Jeff Archer27-Nov-09 7:50 
GeneralRe: Question about double #INF and #NAN Pin
CPallini27-Nov-09 8:03
mveCPallini27-Nov-09 8:03 
GeneralRe: Question about double #INF and #NAN [modified] Pin
Jeff Archer27-Nov-09 8:39
Jeff Archer27-Nov-09 8:39 
Sorry, I guess I didn't present that very well.

NAN is an exponent of 0x7FF with a non-zero mantissa.
INF is an exponent of 0x7FF with a zero mantissa.

Here are the actual fuctions I am using...

bool IsInf (double d)
{
      const INT64 iInf = 0x7FF0000000000000;

      if ((*(INT64*)&d & 0x7FFFFFFFFFFFFFFF) == iInf)
            return true;
      return false;
}

bool IsNan (double d)
{
      INT64 exp = *(INT64*)&d & 0x7FF0000000000000;
      INT64 mantissa = *(INT64*)&d & 0x000FFFFFFFFFFFFF;
      if (exp == 0x7FF0000000000000 && mantissa != 0)
            return true;
      return false;
}

modified on Friday, November 27, 2009 3:04 PM

QuestionUsing COM Object Invalid Pointer Error Pin
Ash_VCPP27-Nov-09 1:18
Ash_VCPP27-Nov-09 1:18 
AnswerRe: Using COM Object Invalid Pointer Error Pin
Richard MacCutchan27-Nov-09 2:11
mveRichard MacCutchan27-Nov-09 2:11 
GeneralRe: Using COM Object Invalid Pointer Error Pin
Ash_VCPP27-Nov-09 2:18
Ash_VCPP27-Nov-09 2:18 
GeneralRe: Using COM Object Invalid Pointer Error Pin
Richard MacCutchan27-Nov-09 2:22
mveRichard MacCutchan27-Nov-09 2:22 
GeneralRe: Using COM Object Invalid Pointer Error Pin
Ash_VCPP27-Nov-09 2:33
Ash_VCPP27-Nov-09 2:33 
GeneralRe: Using COM Object Invalid Pointer Error Pin
Richard MacCutchan27-Nov-09 2:59
mveRichard MacCutchan27-Nov-09 2:59 
AnswerRe: Using COM Object Invalid Pointer Error Pin
Jeff Archer27-Nov-09 5:13
Jeff Archer27-Nov-09 5:13 
GeneralRe: Using COM Object Invalid Pointer Error Pin
Ash_VCPP29-Nov-09 21:39
Ash_VCPP29-Nov-09 21:39 
GeneralRe: Using COM Object Invalid Pointer Error Pin
Jeff Archer2-Dec-09 2:10
Jeff Archer2-Dec-09 2:10 
Questionc++ reading a large text file with fstream Pin
nuttynibbles26-Nov-09 22:24
nuttynibbles26-Nov-09 22:24 
AnswerRe: c++ reading a large text file with fstream Pin
T210226-Nov-09 22:36
T210226-Nov-09 22:36 
GeneralRe: c++ reading a large text file with fstream Pin
nuttynibbles26-Nov-09 22:50
nuttynibbles26-Nov-09 22:50 
GeneralRe: c++ reading a large text file with fstream Pin
nuttynibbles26-Nov-09 22:59
nuttynibbles26-Nov-09 22:59 
GeneralRe: c++ reading a large text file with fstream Pin
Richard MacCutchan26-Nov-09 23:36
mveRichard MacCutchan26-Nov-09 23:36 
GeneralRe: c++ reading a large text file with fstream Pin
nuttynibbles27-Nov-09 2:01
nuttynibbles27-Nov-09 2:01 
QuestionAccessing the command line via Visual C++ Pin
N. Rackley26-Nov-09 21:57
N. Rackley26-Nov-09 21:57 
AnswerRe: Accessing the command line via Visual C++ Pin
Richard MacCutchan27-Nov-09 2:19
mveRichard MacCutchan27-Nov-09 2:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.