fix ZAM "cat" of doubles/times to include trailing ".0" per normal BiF behavior

This commit is contained in:
Vern Paxson 2024-03-20 14:15:40 -07:00 committed by Tim Wojtulewicz
parent 86d1812d49
commit 4cafacf90b
5 changed files with 48 additions and 15 deletions

View file

@ -571,6 +571,15 @@ std::string json_escape_utf8(const std::string& val, bool escape_printable_contr
*/
std::string json_escape_utf8(const char* val, size_t val_size, bool escape_printable_controls = true);
/**
* Checks for values that are approximately equal.
* @param a first value to compare
* @param b second value to compare
* @param tolerance how close they need to be to deem them "approximately equal"
* @return true if `a` is within the given tolerance of `b`, false otherwise
*/
bool approx_equal(double a, double b, double tolerance = std::numeric_limits<double>::epsilon());
/**
* Splits a string at all occurrences of a delimiter. Successive occurrences
* of the delimiter will be split into multiple pieces.