IBM Lotus Symphony
|
返回数字表达式的绝对值。
Abs (Number)
双倍行距
数字:要返回绝对值的任何数字表达式。正数(包括 0)返回的值不变,而负数则被转换成正数。
下面的示例使用 Abs 函数计算两个数值之差。数值的输入顺序不会影响计算结果。
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