15,888,454 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Subrat 4708266 (Top 7 by date)
Subrat 4708266
30-Sep-14 20:41pm
View
>>You did not mention what did you do the option.
I have not changed any option except locale(German<->English)
>>why messing with log?
Without log how I'll come to know what is behind the screen?
>>"S/W works fine" is not informative.
It means, all operations are as per intended.Without exception.
>>You did not even report in what line the exception was thrown...
Exception throws at line z=x/y
Subrat 4708266
30-Sep-14 20:02pm
View
Brief:
I have kept log to track what is value of numerator and denominator. And also the resultant division.
Ex:
double x = 0.0, y = 0.0, z = 0.0;
x=GetX();
LOG(x);
y=GetY();
LOG(y);
z=x/y;
LOG(z);
Experiment-1
Steps:
1. Change the project setting->Locale to German
2. Build the application
3. Run in WIN-8 64 bit English OS.
4. S/W Works fine.
5. In log, I am finding y=0, z = NAN. Because of this NAN, it's not throwing exception.
Experiment-2(Frustrating)
Steps:
1. Change the project setting->Locale to English United State
2. Build the application
3. Run in WIN-8 64 bit English OS.
4. S/W throws exception.
5. Collected the log and found, y=0. Then no log about z, because of crash. During evaluation of z, it's throwing exception.
Subrat 4708266
30-Sep-14 19:26pm
View
I'll try the soln. provided by you. But my major concern lies in locale independent operation. I am runing the build in same CPU architecture. Where it's giving NAN for German build and Exception for English. I'm just changing the locale option in the project settings. Other options remains same for getting German/English build.
One more observation I can add to above comment.
NAN can be checked as follows.
if(result == result)
Not a NAN/ Valid operation
else
NAN
means if you compare NAN with NAN using same variable, it fails to indicate it is not a number. Generally if you will see, always x==x should be true. But that is not the case in case of NAN.
Subrat 4708266
30-Sep-14 11:58am
View
Exactly. I want to know how in different locale,it's behaving differently?
If you will get NAN, you won't get exception. But if it's unable to convert to NAN, then exception.
Subrat 4708266
30-Sep-14 11:53am
View
Have you aware of Embarcadero? Do you have it?
Simply run following code.
double x = 0.0, y = 0.0;
double z = x/y;
See the program in WIN-8 64bit and WIN XP.
Change the locale settings to German in IDE, build and check.
Subrat 4708266
30-Sep-14 11:47am
View
I added log before the division operation. and found it's giving NAN and working fine.
But that is not the case while my English locale build is running in WIN8 64-bit. It throws exception.
FYI: In log I'm printing the denominator i.e shows 0.
I'm wonder same s/w without changing any thing else except locale to German, is giving NAN in log and don't throw any exception.
Subrat 4708266
30-Sep-14 11:44am
View
I don't know, how to move to C++ windows?
Show More