Click here to Skip to main content
15,900,664 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Cut Digits from 0.1000000000001 Pin
David Crow18-Oct-06 3:12
David Crow18-Oct-06 3:12 
QuestionHow to Update the path of the file..... Pin
Anamika200518-Oct-06 1:53
Anamika200518-Oct-06 1:53 
AnswerRe: How to Update the path of the file..... Pin
Christian Graus18-Oct-06 1:59
protectorChristian Graus18-Oct-06 1:59 
GeneralRe: How to Update the path of the file..... Pin
Anamika200518-Oct-06 2:28
Anamika200518-Oct-06 2:28 
GeneralRe: How to Update the path of the file..... Pin
David Crow18-Oct-06 3:14
David Crow18-Oct-06 3:14 
GeneralRe: How to Update the path of the file..... Pin
Anamika200518-Oct-06 18:21
Anamika200518-Oct-06 18:21 
GeneralRe: How to Update the path of the file..... Pin
David Crow19-Oct-06 4:35
David Crow19-Oct-06 4:35 
Questionfloating point model differences in VS2005 and VS2003 Pin
prakash reddy18-Oct-06 1:45
prakash reddy18-Oct-06 1:45 
Hi,

We are working on a scientifical related product which is most sensitive towards mathematical functions (even 7th decimal place chang can cause considereble differences in the output values). We’ve observed that the trignometric functions are behaving differently in Visual C++ 2003 and Visual C++ 2005 versions. We've recently upgraded IDE from VS2003 to VS2005 and compiled the unmanaged vc++ code in both versions.

To explain this in detail, please consider the following console application and please compile it in both 2003 and 2005 versions.

// CosSinDemo.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <math.h>

const float PI = 3.1415926535f;
const float PI_OVER_180 = PI / 180.0f;

int _tmain(int argc, _TCHAR* argv[])
{
static double fDummy1 = 0;
static double fDummy2 = 0;
float fDiffLat = -0.19629669; //input values to cos()
float fDiffLon = 0.060424805;

fDummy1 = cos( fDiffLon * PI_OVER_180);
fDummy2 = cos( -fDiffLat* PI_OVER_180);
printf("fDummy1 - %3.20f\nfDummy2 - %3.20f", fDummy1, fDummy2);
return 0;
}

output with VS2005:
fDummy1 - 0.99999946355819702000
fDummy2 - 0.99999415874481201000

output with VS2003:
fDummy1 - 0.99999944389707407000
fDummy2 - 0.99999413118713976000


The values are differing in 7th decimal place. Could you please someone help me out on how to make VS2005 cos/sin functions behave same as was there in 2003 version.

cheers,
PraK

AnswerRe: floating point model differences in VS2005 and VS2003 Pin
Christian Graus18-Oct-06 2:00
protectorChristian Graus18-Oct-06 2:00 
GeneralRe: floating point model differences in VS2005 and VS2003 Pin
prakash reddy18-Oct-06 21:31
prakash reddy18-Oct-06 21:31 
AnswerRe: floating point model differences in VS2005 and VS2003 Pin
David Crow18-Oct-06 3:18
David Crow18-Oct-06 3:18 
QuestionComponents alway in center Pin
baerten18-Oct-06 1:24
baerten18-Oct-06 1:24 
AnswerRe: Components alway in center Pin
Christian Graus18-Oct-06 1:25
protectorChristian Graus18-Oct-06 1:25 
GeneralRe: Components alway in center Pin
baerten18-Oct-06 1:29
baerten18-Oct-06 1:29 
GeneralRe: Components alway in center Pin
Christian Graus18-Oct-06 1:34
protectorChristian Graus18-Oct-06 1:34 
Questionchecking string is defined or undefined Pin
priyank_ldce18-Oct-06 1:10
priyank_ldce18-Oct-06 1:10 
AnswerRe: checking string is defined or undefined Pin
Christian Graus18-Oct-06 1:26
protectorChristian Graus18-Oct-06 1:26 
AnswerRe: checking string is defined or undefined Pin
Michael Dunn18-Oct-06 15:53
sitebuilderMichael Dunn18-Oct-06 15:53 
QuestionVC++ 6.0 32 bit App running on 64 bit system problem Pin
LittleYellowBird18-Oct-06 0:49
LittleYellowBird18-Oct-06 0:49 
AnswerRe: VC++ 6.0 32 bit App running on 64 bit system problem Pin
Mark Salsbery18-Oct-06 6:00
Mark Salsbery18-Oct-06 6:00 
GeneralRe: VC++ 6.0 32 bit App running on 64 bit system problem Pin
LittleYellowBird19-Oct-06 4:32
LittleYellowBird19-Oct-06 4:32 
AnswerRe: VC++ 6.0 32 bit App running on 64 bit system problem Pin
Michael Dunn18-Oct-06 15:55
sitebuilderMichael Dunn18-Oct-06 15:55 
GeneralRe: VC++ 6.0 32 bit App running on 64 bit system problem Pin
LittleYellowBird19-Oct-06 4:38
LittleYellowBird19-Oct-06 4:38 
GeneralRe: VC++ 6.0 32 bit App running on 64 bit system problem Pin
Michael Dunn20-Oct-06 8:16
sitebuilderMichael Dunn20-Oct-06 8:16 
QuestionA continuous random number generator? Pin
avimitrani18-Oct-06 0:10
avimitrani18-Oct-06 0:10 

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.