gpt4 book ai didi

vb6 - 为什么long l = 1000 * 60会导致溢出?

转载 作者:行者123 更新时间:2023-12-03 07:58:40 24 4
gpt4 key购买 nike

我有这一行:

    Dim l&
l = 1000 * 60 '1 min

它会引发溢出错误。

这是为什么?

最佳答案

Vb 的帮助说:

You attempt to use a number in a calculation, and that number iscoerced into an integer, but the result is larger than an integer. Forexample:

Dim x As Long
x = 2000 * 365 ' Error: Overflow

To work around this situation, type the number, like this:

Dim x As Long
x = CLng(2000) * 365

关于vb6 - 为什么long l = 1000 * 60会导致溢出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75117202/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com