fixed NaN in JSON (fixes #225)
This commit is contained in:
@@ -696,6 +696,14 @@ result_t NumberDataType::readSymbols(size_t offset, size_t length, const SymbolS
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (isnan(val)) {
|
||||
if (outputFormat & OF_JSON) {
|
||||
*output << "null";
|
||||
} else {
|
||||
*output << nullptr_VALUE;
|
||||
}
|
||||
return RESULT_OK;
|
||||
}
|
||||
if (val != 0.0) {
|
||||
if (m_divisor < 0) {
|
||||
val *= static_cast<float>(-m_divisor);
|
||||
|
||||
@@ -412,6 +412,7 @@ int main() {
|
||||
{"x,,exp", "-32.767", "10feffff04681103c2", "00", ""},
|
||||
{"x,,exp,1000", "-0.000090000", "10feffff04ec51b8bd", "00", ""},
|
||||
{"x,,exp,-100", "-9", "10feffff04ec51b8bd", "00", ""},
|
||||
{"x,,exp", "-", "10feffff040000c07f", "00", "W"},
|
||||
{"x,,exr", "-0.09", "10feffff04bdb851ec", "00", ""},
|
||||
{"x,,exr", "0.0", "10feffff0400000000", "00", ""},
|
||||
{"x,,exr", "-0.001", "10feffff04ba83126f", "00", ""},
|
||||
|
||||
Reference in New Issue
Block a user