数值不稳定
我正在为算法课程做一些线性编程练习,在这样做的过程中,我手动解决了许多带有分数的运算。在这样做的过程中,我意识到人类不会遭受数字不稳定的困扰:我们只是将值保留在分数表示中,最后我们评估(可能通过使用计算器)表达式的值。
有什么技术可以自动执行此操作吗?
我正在考虑实现某种符号计算、在内部简化数字并最终仅在表达式求值期间产生值的东西。
I'm doing some Linear programming exercises for the course of Algorithms, and in doing this I'm solving manually many operations with fractions. In doing this I realized that a human being don't suffer from numeric instability: we just keep values in fractional representation, and we finally evaluate (possibly by using a calculator) the value of expressions.
Is there any technique that does this automatically?
Im thinking of something which achieves some kind of symbolic computation, simplifies the numbers internally and finally yields the value only during the evaluation of an expression.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Boost 包含一个有理数库这里,它可能是帮助。
Boost contains a rational number library here which might be of help.
在Python中,你可以查看分数:
In Python you can have a look at fractions: