Is it better to use TFloatPoint or TFixedPoint in GR32?

To plot a scene, a decision must be made between using TFixedPoint and TFloatPoint for all geometries and mathematics. GR32 uses both Fixed and Float.

  • Why are there two types of points in GR32?
  • Which is faster / more efficient?
  • Which is safer?
  • Any other suggestions on this issue?

Operational boundaries for the chart:

  • max 500 primitives / elements per node, avg - 20
  • max 2000 knots per stage, avg - 250

Graph Features:

  • Graphics - 2d
  • Graphics must be of high quality
  • Animation required
  • Isometric Projections Required

Intended use for the chart:

  • Business graphics (graphs, grids, etc.)
  • Modeling tool
  • Text view
  • Process modeling
+4
source share
1 answer

Fixed-point maths are usually faster, so TFixedPoint will perform mathematically faster.

A floating point may (depending on the degree of accuracy used for the values ​​of a fixed point) provide greater accuracy than a fixed point, but will not be performed so quickly in terms of mathematical procedures.

Is "security" too subjective to answer ... safer?

According to your final part of the question, it depends on what you value more: accuracy or performance.

If your primary goal is accuracy, go to TFloatPoint. If performance is your primary goal, go to TFixedPoint.

+2
source

Source: https://habr.com/ru/post/1384391/


All Articles