Solved

Generate NaN double value in c code running on windows

Posted on 2009-03-29
1
924 Views
Last Modified: 2012-05-06
I'd like to generate a NaN value for a given double variable in c code running on windows.
I tried to do the following:
double d = sqrt(-1);
This code generates "-1.#IND00" instead of NaN when running on windows.
In Linux the same code generates NaN.


double d = sqrt(-1);

output => d => "-1.#IND00"

Open in new window

0
Comment
Question by:optimaltest
1 Comment
 
LVL 9

Accepted Solution

by:
masheik earned 500 total points
ID: 24016515
Windows displays a NaN as -1.#IND  here, "IND" for "indeterminate"
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
My eclipse editor won't start ? 4 142
why "." vs "->" 23 119
xamarin c# deserialize Json containing nested object 2 79
Raspberry Pi 3 to send text message 9 65
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

943 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

1 Experts available now in Live!

Get 1:1 Help Now