MCPcopy Create free account
hub / github.com/ElementsProject/elements / DoubleEquals

Function DoubleEquals

src/test/blockchain_tests.cpp:17–20  ·  view source on GitHub ↗

Equality between doubles is imprecise. Comparison should be done * with a small threshold of tolerance, rather than exact equality. */

Source from the content-addressed store, hash-verified

15 * with a small threshold of tolerance, rather than exact equality.
16 */
17static bool DoubleEquals(double a, double b, double epsilon)
18{
19 return std::abs(a - b) < epsilon;
20}
21
22static CBlockIndex* CreateBlockIndexWithNbits(uint32_t nbits)
23{

Callers 1

RejectDifficultyMismatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected