Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ double is nan

/* isnan example */
#include <stdio.h>      /* printf */
#include <math.h>       /* isnan, sqrt */

int main()
{
  printf ("isnan(0.0)       : %d
",isnan(0.0));
  printf ("isnan(1.0/0.0)   : %d
",isnan(1.0/0.0));
  printf ("isnan(-1.0/0.0)  : %d
",isnan(-1.0/0.0));
  printf ("isnan(sqrt(-1.0)): %d
",isnan(sqrt(-1.0)));
  return 0;
}
Comment

C++ is nan

doubel a = 0 ;
bool isnan_a = std::isnan(a) || std::isnan(-a);
Comment

PREVIOUS NEXT
Code Example
Cpp :: how to sort vector of struct in c++ 
Cpp :: c++ casting 
Cpp :: remove specific element from vector c++ 
Cpp :: how to read files in c++ 
Cpp :: untitled goose game 
Cpp :: c++ create thread 
Cpp :: iterate through map c++ 
Cpp :: print duplicate characters from string in c++ 
Cpp :: stl vector 
Cpp :: Palindrome String solution in c++ 
Cpp :: arduino xor checksum 
Cpp :: ++i and i++ 
Cpp :: a square plus b square plus c square 
Cpp :: c include 
Cpp :: tree to array c++ 
Cpp :: c++ initialize a vector 
Cpp :: c++ vector remove all duplicate elements 
Cpp :: length of number c++ 
Cpp :: c++ find object in vector by attribute 
Cpp :: size() in c++ SET 
Cpp :: c++ get pointer from unique_ptr 
Cpp :: reverse an array in c++ stl 
Cpp :: char to int in c++ 
Cpp :: overload subscript operator cpp 
Cpp :: cknuth hash 
Cpp :: User defined functions and variables in C++ programming 
Cpp :: UENUM ue4 
Cpp :: what library is rand in c++ 
Cpp :: c++ garbage collection 
Cpp :: c++ stl vector get iterator from index 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =