mirror of
https://github.com/13hannes11/UU_la_parallel_programming_practical_assignments.git
synced 2024-09-04 00:50:58 +02:00
add test functions
This commit is contained in:
11
cpp_template/calc.cpp
Normal file
11
cpp_template/calc.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include <math.h>
|
||||
|
||||
// Get the Square root of a number.
|
||||
double squareRoot(const double a)
|
||||
{
|
||||
double b = sqrt(a);
|
||||
if(b != b) // NaN check
|
||||
{ return -1.0; }
|
||||
else
|
||||
{ return sqrt(a); }
|
||||
}
|
||||
Reference in New Issue
Block a user