开发者

C++ function to chop very small numerical values

Is there a C++ function that chops 开发者_开发百科very small numerical values that appear due to approximations of the floating point numbers in the CPU to zero? I want to use this in complex number calculation, so it can appear in either the real or imaginary parts.


No such function exists. The problem is that "small" is relative. If you're working on very large numbers, 1.0 can be considered small enough to chop. Similarly, if you're working with small numbers, 10^-30 could still be considered significant.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜