Click here to Skip to main content
15,914,071 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCreating a graphic control within a DLL Pin
ilgale3-Mar-08 3:07
ilgale3-Mar-08 3:07 
GeneralRe: Creating a graphic control within a DLL Pin
CPallini3-Mar-08 3:23
mveCPallini3-Mar-08 3:23 
GeneralDebugBreak continue issue Pin
George_George3-Mar-08 2:58
George_George3-Mar-08 2:58 
Generaldifference between CComPtr <ipin> and IPin*</ipin> Pin
hanlei00000000093-Mar-08 2:56
hanlei00000000093-Mar-08 2:56 
GeneralRe: difference between CComPtr and IPin* Pin
CPallini3-Mar-08 3:12
mveCPallini3-Mar-08 3:12 
GeneralRe: difference between CComPtr and IPin* Pin
Alexander M.,3-Mar-08 3:27
Alexander M.,3-Mar-08 3:27 
GeneralRe: difference between CComPtr and IPin* Pin
CPallini3-Mar-08 3:47
mveCPallini3-Mar-08 3:47 
QuestionProblem while convesion from Float to int using VC++ 6.0 Pin
Kishore JP3-Mar-08 2:55
Kishore JP3-Mar-08 2:55 
Hello All,
Please go through the following piece of code which is giving problem.
#include <iostream.h>
void main()
{
int angle = 2330,angul_step=55;//change angul_step to 60
float nAngle = (float)(angle / 10) - 2;
float nAngulationStep = (float)angul_step / 100;
float nFrames = (int)(nAngle/nAngulationStep);
int nPhaseFrames = (int)nFrames + 1;
cout<<"The nFrames is "<<nFrames<<endl;
cout<<"The nPhaseFrames is "<<nPhaseFrames<<endl;
}
The out put is in Debug mode.
The nFrames is 419
The nPhaseFrames is 420
The out put is in Release mode
The nFrames is 420
The nPhaseFrames is 421

In the same way: If you change the angul_step to 60 and run the out put in Debug and Release mode are
Debug mode:
The nFrames is 384
The nPhaseFrames is 385
The out put in Release mode is
The nFrames is 385
The nPhaseFrames is 386

I have replace Float with Double:
The output are different.
Debug mode:
The nFrames is 419
The nPhaseFrames is 420
Release Mode:
The nFrames is 420
The nPhaseFrames is 421

In the same way: If you change the angul_step to 60 and run the out put in Debug and Release mode are
Debug Mode
The nFrames is 385
The nPhaseFrames is 386
Release Mode
The nFrames is 385
The nPhaseFrames is 386

Changing float to double works only for specific numbers. The problem is unknown to me.
Please let me know if any one had this experience and solution.
I need to calculate the value "ROUNDDOWN((Angle-2)/AngulationStep)+1"
where Angle will be ((angle/10) -2) and angulation Step would be angul_step/100.
Thanks much.
Kishore
GeneralRe: Problem while convesion from Float to int using VC++ 6.0 Pin
David Crow3-Mar-08 3:02
David Crow3-Mar-08 3:02 
GeneralRe: Problem while convesion from Float to int using VC++ 6.0 Pin
CPallini3-Mar-08 3:06
mveCPallini3-Mar-08 3:06 
GeneralRe: Problem while convesion from Float to int using VC++ 6.0 Pin
jhwurmbach3-Mar-08 3:09
jhwurmbach3-Mar-08 3:09 
AnswerRe: Problem while convesion from Float to int using VC++ 6.0 Pin
Kishore JP16-Mar-08 1:20
Kishore JP16-Mar-08 1:20 
GeneralRe: Problem while convesion from Float to int using VC++ 6.0 Pin
jhwurmbach16-Mar-08 22:19
jhwurmbach16-Mar-08 22:19 
Generalprocesses Pin
duta3-Mar-08 2:16
duta3-Mar-08 2:16 
QuestionRe: processes Pin
David Crow3-Mar-08 3:06
David Crow3-Mar-08 3:06 
GeneralRe: processes Pin
Hamid_RT3-Mar-08 21:06
Hamid_RT3-Mar-08 21:06 
QuestionCANCEL BUTTON Pin
Adnan Merter3-Mar-08 1:17
Adnan Merter3-Mar-08 1:17 
QuestionRe: CANCEL BUTTON Pin
CPallini3-Mar-08 2:59
mveCPallini3-Mar-08 2:59 
QuestionRe: CANCEL BUTTON Pin
David Crow3-Mar-08 3:07
David Crow3-Mar-08 3:07 
QuestionRe: CANCEL BUTTON Pin
Adnan Merter3-Mar-08 3:57
Adnan Merter3-Mar-08 3:57 
GeneralRe: CANCEL BUTTON Pin
David Crow3-Mar-08 4:18
David Crow3-Mar-08 4:18 
GeneralRe: CANCEL BUTTON Pin
Randor 3-Mar-08 4:29
professional Randor 3-Mar-08 4:29 
GeneralDebugBreak Pin
George_George3-Mar-08 1:08
George_George3-Mar-08 1:08 
GeneralRe: DebugBreak Pin
Matthew Faithfull3-Mar-08 1:19
Matthew Faithfull3-Mar-08 1:19 
GeneralRe: DebugBreak Pin
George_George3-Mar-08 1:36
George_George3-Mar-08 1:36 

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.