Opened 4 years ago

Closed 4 years ago

#5856 closed defect (fixed)

Use helper function instead of QString::number(double)

Reported by: sjoelund.se Owned by: adeas31
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:1 Changed 4 years ago by sjoelund.se

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.

Last edited 4 years ago by sjoelund.se (previous) (diff)

comment:2 Changed 4 years ago by adeas31

  • Milestone changed from Future to 1.16.0
  • Resolution set to fixed
  • Status changed from new to 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.