VBMath 类

定义

VbMath 模块包含用于执行数学运算的过程。

public ref class VBMath sealed
[Microsoft.VisualBasic.CompilerServices.StandardModule]
public sealed class VBMath
[<Microsoft.VisualBasic.CompilerServices.StandardModule>]
type VBMath = class
Public Module VBMath
继承
VBMath
属性

示例

此示例使用 Rnd 函数在 1 到 6 的范围内生成随机整数值。

' Initialize the random-number generator.
Randomize()
' Generate random value between 1 and 6.
Dim value As Integer = CInt(Int((6 * Rnd()) + 1))

注解

此模块支持Visual Basic语言关键字和运行时库成员来生成随机数。

方法

名称 说明
Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
Randomize()

初始化随机数字生成器。

Randomize(Double)

初始化随机数字生成器。

Rnd()

返回随机类型的 Single数。

Rnd(Single)

返回随机类型的 Single数。

ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于

另请参阅