MCPcopy Create free account
hub / github.com/apache/mesos / convertToFloating

Function convertToFloating

src/v1/values.cpp:62–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61
62static double convertToFloating(long long fixedValue)
63{
64 // NOTE: We do the conversion from fixed point via integer division
65 // and then modulus, rather than a single floating point division.
66 // This ensures that we only apply floating point division to inputs
67 // in the range [0,999], which is easier to check for correctness.
68 double quotient = static_cast<double>(fixedValue / 1000);
69 double remainder = static_cast<double>(fixedValue % 1000) / 1000.0;
70
71 return quotient + remainder;
72}
73
74
75ostream& operator<<(ostream& stream, const Value::Scalar& scalar)

Callers 1

values.cppFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected