Signature (Visual Basic / VBA)
Public Function Absolute( _
ByVal vX As Variant _
) As Variant
Code Example
Absolute(-2.3) = 2.3
Absolute(0) = 0
Absolute(2.3) = 2.3
Absolute(2.3) = 2.3
Absolute("1|1") = 1.4142135623731
Absolute("4|5") = 6.40312423743285
Absolute("-4|-3") = 5
Parameters
| Parameter | Description |
|---|---|
| vX | Either a real number whose absolute value is to be returned, or a complex number whose norm is to be returned. Function returns Null if vX is Null or cannot be fixed up to a real/complex number (as defined by the ComplexStringToReals function). |
Notes & Version History
| Note | This function calculates the hypotenuse of a right triangle with sides X and Y when given a complex number of the form "X|Y" |