gpt4 book ai didi

c# - Math.Pow 中 VB 中的奇怪转换

转载 作者:行者123 更新时间:2023-12-02 22:34:10 26 4
gpt4 key购买 nike

这段代码运行良好

Dim bc As Long = Math.Pow(36, ((IBase36.Length - 1) - i))

<强>!在 VB Math.Pow 下返回 DOUBLE 数据类型。

当我将它转换为 C# 时,我得到了

long bc = Math.Pow(36, ((IBase36.Length - 1) - i));

我有一个转换语法问题。

如何解决?

最佳答案

long bc = (long)Math.Pow(36, ((IBase36.Length - 1) -i));

() 是 cast operator在 C# 中。

关于c# - Math.Pow 中 VB 中的奇怪转换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11727497/

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