Actions
Bug #860
closedIncorrect conversion of numeric_limits<double>::max by OFStandard::ftoa()
Start date:
2018-11-30
Due date:
% Done:
100%
Estimated time:
30:00 h
Module:
ofstd
Operating System:
Compiler:
Description
While writing some unit tests, I've observed a potential issue with ofstd::ftoa(). When reading a value from a tag of VR: FD to OFstring, the value represented by the string is incorrect, if the value of the tag is the upper boundary of double (std::numeric_limits<double>::max). While the value in the tag is 1.7976931348623157e+308, the value of the string is 1.7976931348623167e+308. Now the string cannot be converted to double (e.g. using std::stod), because it exceeds the representable maximum of double. The conversion seems to be correct when using sprintf instead of ftoa.
Reported by DCMTK forum user "FKupsch": https://forum.dcmtk.org/viewtopic.php?f=1&t=4806
Updated by Marco Eichelberg about 1 year ago
- Status changed from New to Closed
- Assignee set to Marco Eichelberg
- % Done changed from 0 to 100
- Estimated time set to 30:00 h
Closed by commit #3a8e3bc8e.
Actions