Click here to Skip to main content
15,881,092 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to bypass login window? Pin
Monty231-Dec-03 0:21
Monty231-Dec-03 0:21 
GeneralRe: How to bypass login window? Pin
1-Jan-04 18:32
suss1-Jan-04 18:32 
GeneralRe: How to bypass login window? Pin
Monty21-Jan-04 21:02
Monty21-Jan-04 21:02 
QuestionHow to enumerate all users from Windows? Pin
Butnariu30-Dec-03 23:42
Butnariu30-Dec-03 23:42 
AnswerRe: How to enumerate all users from Windows? Pin
valikac31-Dec-03 5:36
valikac31-Dec-03 5:36 
GeneralVC++ : linking problems Pin
Vincent Sim30-Dec-03 21:40
Vincent Sim30-Dec-03 21:40 
GeneralRe: VC++ : linking problems Pin
Balkrishna Talele30-Dec-03 22:13
Balkrishna Talele30-Dec-03 22:13 
GeneralDifference of Floating Point Optimization in Fortran & C++ Pin
APV30-Dec-03 21:35
APV30-Dec-03 21:35 
Hi Everyone

This is very urgent. The problem which we are facing in our project is related to the floating point optimizations performed in VC++. The following code snippet elaborates this:


program main
double precision::a,b,x
a = 1.D0
b = 0.1
x = a/b
write(*,*) x
end program main

The above program construct in Fortran stores b as 0.100000001490116 & computes x as 9.99999985098839.

The same equivalent construct in C++ with double variables stores b as 0.10000000000 & computes x as 10.00000000000.However if we declare b as float we get similar results(but our project can’t use floats).

The difference in the results is attributed to the fact that C++ perhaps performs some optimizations to store values of type 1/10 1/100 etc.Hence gives expected results.

Our project requires similarity in results across Fortran & C++.Also we are only free to make changes in the C++ code.We have tried few things in this regard like /Op switch, _control87 & _controlfp.routines with different arguments but couldn’t resolve the problem.

What is required precisely is that the following code segment should assign x the value 9.99999985098839 & that too there should be some global setting sort of thing in VC environment as the code spans around 3 lakh lines which makes it difficult to make changes everywhere.

Void main(void)
{
double a,b,x;
a = 1.0;
b = 0.1
x = a/b;
}



Any help in this regard will be highly appreciated.

Thank you.

-apv

GeneralRe: Difference of Floating Point Optimization in Fortran & C++ Pin
PJ Arends30-Dec-03 21:51
professionalPJ Arends30-Dec-03 21:51 
GeneralRe: Difference of Floating Point Optimization in Fortran & C++ Pin
Ted Ferenc30-Dec-03 21:53
Ted Ferenc30-Dec-03 21:53 
GeneralRe: Difference of Floating Point Optimization in Fortran & C++ Pin
markkuk30-Dec-03 22:59
markkuk30-Dec-03 22:59 
GeneralMFC with 2 views using Doc/View style Pin
R. Thomas30-Dec-03 20:58
R. Thomas30-Dec-03 20:58 
GeneralRe: MFC with 2 views using Doc/View style Pin
Monty230-Dec-03 21:17
Monty230-Dec-03 21:17 
GeneralRe: MFC with 2 views using Doc/View style Pin
R. Thomas1-Jan-04 15:56
R. Thomas1-Jan-04 15:56 
GeneralQuery in Microsoft Installshield for VC++ Pin
bhargav_ram30-Dec-03 20:34
bhargav_ram30-Dec-03 20:34 
GeneralShellExecute or WinExec!! Pin
abc87630-Dec-03 20:19
abc87630-Dec-03 20:19 
GeneralRe: ShellExecute or WinExec!! Pin
Robert Kuster31-Dec-03 1:17
Robert Kuster31-Dec-03 1:17 
Generalhelp in an active x control Pin
safee ullah30-Dec-03 18:51
safee ullah30-Dec-03 18:51 
GeneralDeployment of project Pin
Ming Yan30-Dec-03 18:19
Ming Yan30-Dec-03 18:19 
GeneralRe: Deployment of project Pin
Monty230-Dec-03 18:39
Monty230-Dec-03 18:39 
GeneralRe: Deployment of project Pin
Ming Yan30-Dec-03 18:50
Ming Yan30-Dec-03 18:50 
QuestionHow to use vb ocx in vc++ Pin
percyvimal30-Dec-03 18:10
percyvimal30-Dec-03 18:10 
AnswerRe: How to use vb ocx in vc++ Pin
bryce30-Dec-03 18:24
bryce30-Dec-03 18:24 
GeneralSending Extended ascii character with PostMessage api in vc++ Pin
percyvimal30-Dec-03 18:05
percyvimal30-Dec-03 18:05 
Generalmultithreaded sockets bollocks ;) Pin
bryce30-Dec-03 17:14
bryce30-Dec-03 17:14 

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.