操纵不适用于大数
为什么 Manipulate[]
不能处理大数? 例如,这可行
Manipulate[k, {k, 0, 1000000000, 1}]
,而这不可行,
Manipulate[k, {k, 0, 10000000000, 1}]
我相信应该有一些 Mathematica 变量会影响这一点,但我找不到一个。
Why isn't Manipulate[]
working with large numbers?
For instance this works
Manipulate[k, {k, 0, 1000000000, 1}]
and this doesn't
Manipulate[k, {k, 0, 10000000000, 1}]
I believe that there should be some Mathematica variable which affects this but I cannot find one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是
Manipulate
和Slider
的一个已知错误,特别是当滑块的离散“步骤”超过2^31
时。作为解决方法,您可以执行以下操作,例如:
通过不指定步长(第四个参数),您允许滑块为变量设置非整数值,但您可以通过使用 Round 来解决此问题(或
IntegerPart
)。希望有帮助!
This is a known bug with
Manipulate
andSlider
, specifically when there are more than2^31
discrete "steps" for the slider.As a workaround, you could do the following, for example:
By not specifying the step size (fourth argument), you allow the slider to set non-integer values for the variable, but you can get around this by using
Round
(orIntegerPart
).Hope that helps!