MCPcopy Create free account
hub / github.com/coin-or/CppAD / check_infinity

Function check_infinity

example/general/num_limits.cpp:81–91  ·  view source on GitHub ↗

-----------------------------------------------------------------

Source from the content-addressed store, hash-verified

79 }
80 // -----------------------------------------------------------------
81 bool check_infinity(void)
82 { bool ok = true;
83 Float inf = CppAD::numeric_limits<Float>::infinity();
84 Float hun = Float(100);
85 Float tmp = Float(0);
86 tmp = inf + hun;
87 ok &= inf == tmp;
88 tmp = inf - inf;
89 ok &= CppAD::isnan( tmp );
90 return ok;
91 }
92 // -----------------------------------------------------------------
93 bool check_digits10(void)
94 { bool ok = true;

Callers 1

num_limitsFunction · 0.70

Calls 1

isnanFunction · 0.70

Tested by

no test coverage detected