1 #include <stan/math.hpp> 2 #include <gtest/gtest.h> 3 TEST(MathFunctions,sqrtInt)4TEST(MathFunctions, sqrtInt) { 5 using stan::math::sqrt; 6 EXPECT_FLOAT_EQ(std::sqrt(3.0), sqrt(3)); 7 EXPECT_FLOAT_EQ(std::sqrt(3.1), sqrt(3.1)); 8 EXPECT_TRUE(stan::math::is_nan(sqrt(-2))); 9 10 uint32_t ulong = 1; 11 uint64_t ulonglong = 1; 12 long double ldouble = 1.5; 13 EXPECT_FLOAT_EQ(std::sqrt(ulong), sqrt(ulong)); 14 EXPECT_FLOAT_EQ(std::sqrt(ulonglong), sqrt(ulonglong)); 15 EXPECT_FLOAT_EQ(std::sqrt(ldouble), sqrt(ldouble)); 16 } 17