Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how to check sqrt of number is integer c++

bool isPerfectSquare(long double x) 
{   
  // Find floating point value of  
  // square root of x. 
  long double sr = sqrt(x); 
  
  // If square root is an integer 
  return ((sr - floor(sr)) == 0); 
} 
Comment

PREVIOUS NEXT
Code Example
Cpp :: cpp take lambda as parameter 
Cpp :: minimum and maximum value of a vector in C++ 
Cpp :: spicoli 
Cpp :: fork was not declared in this scope 
Cpp :: OPA in expanse 
Cpp :: clear console c++ 
Cpp :: maximum value in map in c++ 
Cpp :: how to make a c++ program which takes two integers and calculate average 
Cpp :: array 2d dynamic allocation c++ 
Cpp :: sort function descending c++ 
Cpp :: c++ shared pointer 
Cpp :: calling struct to a struct c++ 
Cpp :: how to read a comma delimited file into an array c++ 
Cpp :: convert int to enum c++ 
Cpp :: c++ compare time 
Cpp :: max function in c++ 
Cpp :: how to do nCr in c++ 
Cpp :: switch case c++ 
Cpp :: c++ pointer null vs nullptr 
Cpp :: how to check if a number is prime c++ 
Cpp :: min heap and max heap using priority queue 
Cpp :: cpp float to string 
Cpp :: prime factorisation of a number in c++ 
Cpp :: clear the input buffer in cpp 
Cpp :: c++ template function 
Cpp :: c++ remove numbers from vector if larger than n 
Cpp :: vector length c++ 
Cpp :: insert only unique values into vector 
Cpp :: c++ print binary treenode 
Cpp :: push local branch to another remote branch 
ADD CONTENT
Topic
Content
Source link
Name
9+8 =