开发者

C++ function to chop very small numerical values

开发者 https://www.devze.com 2023-04-07 03:32 出处:网络
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 c

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

精彩评论

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