MCPcopy Create free account
hub / github.com/arq5x/bedtools2 / MakeDouble

Function MakeDouble

src/utils/VectorOps/VectorOps.cpp:18–26  ·  view source on GitHub ↗

functor to convert a single string to a double

Source from the content-addressed store, hash-verified

16
17// functor to convert a single string to a double
18double MakeDouble(const string &element) {
19 std::istringstream i(element);
20 double x;
21 if (!(i >> x)) {
22 cerr << "Error: Could not properly convert string to numeric (\"" + element + "\")" << endl;
23 exit(1);
24 }
25 return x;
26}
27
28// functor to convert the abs() of single string to a double
29double MakeAbsDouble(const string &element) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected