开发者

Reduce the effect of float number (rounding) error

We are implementing some geometric algorithms but found the effect of float numb开发者_开发知识库er calculation error is big. Is there any guide lines to reduce this kind of effects?

The algorithms contains many parts and is very complex. One of the example is to calculate the intersects between a line and a spline (serials of bezier curve). When the line position close to the end point of bezier the result is unstable.

Thanks


  • Use algorithms which are less sensitive to floating point error (see numerical stability)
  • Use wider types (ex. double instead of float)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜