Click here to Skip to main content
15,889,992 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Change Background color of a word in CRichEditCtrl control Pin
Selvam R31-Dec-03 4:54
professionalSelvam R31-Dec-03 4:54 
GeneralRe: Change Background color of a word in CRichEditCtrl control Pin
BazM31-Dec-03 7:57
BazM31-Dec-03 7:57 
GeneralWindows Clipboard Pin
impeham31-Dec-03 2:19
impeham31-Dec-03 2:19 
GeneralRe: Windows Clipboard Pin
valikac31-Dec-03 5:34
valikac31-Dec-03 5:34 
GeneralNeed help with Dos App Pin
RedDragon2k31-Dec-03 2:08
RedDragon2k31-Dec-03 2:08 
GeneralRe: Need help with Dos App Pin
Selvam R31-Dec-03 2:18
professionalSelvam R31-Dec-03 2:18 
GeneralRe: Need help with Dos App Pin
RedDragon2k31-Dec-03 2:20
RedDragon2k31-Dec-03 2:20 
GeneralRe: Need help with Dos App Pin
Hauptman(n)31-Dec-03 8:42
Hauptman(n)31-Dec-03 8:42 
Generalvirtual printer driver Pin
SHOJO31-Dec-03 2:05
SHOJO31-Dec-03 2:05 
QuestionHow to bypass login window? Pin
SiddharthAtw31-Dec-03 0:11
SiddharthAtw31-Dec-03 0:11 
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 

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.