Advertisement
Donald_Fortier

bool isRealNumber( double );// C++

May 28th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. using namespace std;
  2.  
  3. bool isRealNumber( double );// Prototype for this function
  4.  
  5. bool isRealNumber( double real ) {
  6.     if ( real < 0 )
  7.         return false;// Square root of a negative is not a real number
  8.  
  9.     return true;// It's not a negative number, so the square root of it will be a real number.
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement