MCPcopy Create free account
hub / github.com/ablab/spades / getAsDouble

Method getAsDouble

ext/src/llvm/StringRef.cpp:589–603  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

587}
588
589bool StringRef::getAsDouble(double &Result, bool AllowInexact) const {
590 APFloat F(0.0);
591 auto StatusOrErr = F.convertFromString(*this, APFloat::rmNearestTiesToEven);
592 if (errorToBool(StatusOrErr.takeError()))
593 return true;
594
595 APFloat::opStatus Status = *StatusOrErr;
596 if (Status != APFloat::opOK) {
597 if (!AllowInexact || !(Status & APFloat::opInexact))
598 return true;
599 }
600
601 Result = F.convertToDouble();
602 return false;
603}
604
605// Implementation of StringRef hashing.
606hash_code llvm::hash_value(StringRef S) {

Callers

nothing calls this directly

Calls 4

errorToBoolFunction · 0.85
convertFromStringMethod · 0.80
takeErrorMethod · 0.45
convertToDoubleMethod · 0.45

Tested by

no test coverage detected