IsZero

依照預先定義的 Oracle Hyperion Financial Management Epsilon,檢查傳入的值是否接近於 0。此函數可用於所有規則類型中。

建議使用此函數,而非零的精確比較,其中浮點運算引出小於 1 x 10 E-10 的錯誤,可予以忽略。

取代:

Difference = Value1 – Value2 
If Difference = 0 Then
    'process where Difference = 0
Else
    'process where Difference <> 0
End If

使用:

Difference = Value1 – Value2 
If HS.IsZero(Difference) Then
    'process where Difference = 0
Else
    'process where Difference <> 0
End If

語法

BooleanValue = HS.IsZero(Value)

傳回值

如果傳入的值接近於零,則布林值為 True,否則爲 False。

範例

Dim BoolVal 
Dim Value 
Value = 0.000000001 
BoolVal = HS.IsZero(Value) 
If BoolVal = true Then 
   'do processing 
Else 
   'do Processing 
End If