Opened 5 years ago
Closed 5 years ago
#5856 closed defect (fixed)
Use helper function instead of QString::number(double)
Reported by: | Martin Sjölund | Owned by: | Adeel Asghar |
---|---|---|---|
Priority: | high | Milestone: | 1.16.0 |
Component: | OMEdit | Version: | |
Keywords: | Cc: |
Description
QString::number(double)
by default has a low precision, which might truncate values that are significant. One example is on the forums uses rad/deg conversions, which are very imprecise at the moment.
We need to go through all QString::number
calls to prevent similar issues in the future.
Change History (2)
comment:2 by , 5 years ago
Milestone: | Future → 1.16.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in 895904a/OpenModelica.
Added a helper function with default precision of 16. Updated all the places where unit conversions are done since they seems the most vulnerable ones. We could use the helper function in other places if needed in future.
Note:
See TracTickets
for help on using tickets.
https://github.com/OpenModelica/OpenModelica/pull/737 fixes the issue on the forums. We possibly want to print the minimum number of digits that give a different floating point number instead.