ClassSystem.Math SyntaxDim result As type = Math.Abs(value)
DescriptionThe Abs function returns the absolute value of value. The source and return data type are always the same. Usage at a Glance
ExampleThis sample returns the difference between two integers, regardless of their order. Public Function IntegerDiff(ByVal first As Integer, _ ByVal second As Integer) As Integer Return Math.Abs(second - first) End Function Version DifferencesIn VB 6, Abs is an intrinsic VB function. In the .NET platform, it is a member of the System.Math class and not directly part of the VB language. See AlsoSign Function |