MCPcopy Create free account
hub / github.com/catboost/catboost / OnDoubleScalar

Method OnDoubleScalar

library/cpp/yson/writer.cpp:243–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241 }
242
243 void TYsonWriter::OnDoubleScalar(double value) {
244 if (Format == EYsonFormat::Binary) {
245 Stream->Write(NDetail::DoubleMarker);
246 Stream->Write(&value, sizeof(double));
247 } else {
248 auto str = FloatToStringWithNanInf(value);
249 Stream->Write(str);
250 if (str.find('.') == TString::npos && str.find('e') == TString::npos && std::isfinite(value)) {
251 Stream->Write(".");
252 }
253 }
254 EndNode();
255 }
256
257 void TYsonWriter::OnBooleanScalar(bool value) {
258 if (Format == EYsonFormat::Binary) {

Callers 3

ParseNodeMethod · 0.45
ReadNumericMethod · 0.45
operator()Method · 0.45

Calls 4

FloatToStringWithNanInfFunction · 0.85
isfiniteFunction · 0.50
WriteMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected