Share via


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)

適用於

另請參閱