IBM Lotus Symphony


Abs 函数 [运行时]

返回数字表达式的绝对值。

语法:

Abs (Number)

返回值:

双倍行距

参数:

数字:要返回绝对值的任何数字表达式。正数(包括 0)返回的值不变,而负数则被转换成正数。

下面的示例使用 Abs 函数计算两个数值之差。数值的输入顺序不会影响计算结果。

错误代码

5 无效的过程调用

示例:

Sub ExampleDifference

Dim siW1 As Single

Dim siW2 As Single

siW1 = Int(InputBox$ ("Please enter the first amount","Value input") )

siW2 = Int(InputBox$ ("Please enter the second amount","Value input") )

Print "The difference is "; Abs(siW1 - siW2)

End Sub


产品反馈 | 其他文档 | 商标