Solved

Generate NaN double value in c code running on windows

Posted on 2009-03-29
1
933 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

728 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