Click here to Skip to main content
15,906,333 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
//
here call a LibFun() from Static Lib A or Static Lib B, C, ...
//

int nNum = 60;
double dBeginTime = m_pCurImageList->m_dBeginTime;//m_pCurImageList->m_dBeginTime==1271819811.9210
//Execute OK

double dEndTime = m_pCurImageList->m_dEndTime;//m_pCurImageList->m_dEndTime==1271819814.3280;
//Execute OK

double dSpanTime = (dEndTime - dBeginTime) / nNum;
//Execut Eerror. Debug shows "dSpanTime == -1.#IND000000000"

time_t nSumTime = (time_t)((dEndTime - dBeginTime) * 1000.0);
//Execut Eerror. Debug shows nSumTime == 0;


What reaseons can cause it ?? And Why?

Thanks a lot.

PS: The code is executed in a single thread.
It must happen after the thread calls a funciton from Static Lib A.
But everything is normal if thread calls function from any other Static Lib B, C, ...
Posted
Updated 20-Apr-10 19:02pm
v2

You code looks okay.

-1.#IND means result of
C++
(dEndTime - dBeginTime) / nNum
its not a number. This can happen if numbers are used without being initialized or for cases like 0/0, 0/∞, ∞/∞, etc. Can you check the value of the variables again?

-Saurabh
 
Share this answer
 
Which compiler are you using? Are you modifying FP control register?

VC++ 9.0 give me these values:

dSpanTime = 0.040116667747497559
nSumTime = 2407
dTmp = 0.040116666666666669

-Saurabh
 
Share this answer
 
Thanks.

//
here call a LibFun() from Static Lib A or Static Lib B, C, ...
//

int nNum = 60;double dBeginTime = 1271819811.9210
//Execute OK

double dEndTime = 1271819814.3280;
//Execute OK

double dSpanTime = (dEndTime - dBeginTime) / nNum;
//Execut Eerror. Debug shows "dSpanTime == -1.#IND000000000"

time_t nSumTime = (time_t)((dEndTime - dBeginTime) * 1000.0);
//Execut Eerror. Debug shows nSumTime == 0;


The problem remains.

double dTmp = 2.407 / nNum;//Problem ramins.
 
Share this answer
 
v3
To Saurabh.Garg

Thanks a lot.

VC6.0 is being used.

Now I locate the problem in the Static Lib A ( because any other lib is OK).

Some ASM code exists in the Lib.

It's OK before the ASM code, but error after it.

So I think the problem may be caused by the ASM code.

Now the author of the ASM code is checking it.

thank you very much.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900