Signature (Visual Basic / VBA)
Public Function RationalComplexToVBExpr( _
ByVal vExpr As Variant _
) As Variant
Code Example
? RationalComplexToVBExpr(12)
12
? RationalComplexToVBExpr("12")
12
? RationalComplexToVBExpr("12.45")
12.45
? RationalComplexToVBExpr("12.34+56.78*#i")
RealToComplex(12.34, 56.78)
? RationalComplexToVBExpr("45*#i")
RealToComplex(0, 45)
? RationalComplexToVBExpr("12+45*#i")
RealToComplex(12, 45)
? RationalComplexToVBExpr("-12-45*#i")
RealToComplex(-12, -45)
? RationalComplexToVBExpr("23/45+67/89*#i")
RealToComplex(23/45, 67/89)
Parameters
| Parameter | Description |
|---|---|
| vExpr | String containing a numeric expression. Function returns Null if vExpr is Null or cannot be fixed up to a String. The string numeric expression must consist of a real part and/or a complex part. Each part (the real part and the complex part) must consist of either 1) a signed integer constant or 2) a signed rational expression of the form "A/B" where A and B are both integers. The complex part (if any) can be signed and it must be followed by "*#i" to signify that it is the complex part. |
Notes & Version History
| Summary | We used this function to translate several sample numeric values from the form produced by the symbolic math package Derive (by Soft Warehouse, Honolulu, Hawaii; http://www.derive.com/derive.htm) into a form recognized by Visual Basic and supported by various Entisoft Tools functions. We used those sample values to help validate our advanced trigonometric calculations. That validation process is NOT complete; however, each of those functions has been validated with a wide range of input values. |
| Special handling | If vExpr is "1/0" then this function will return " DivideByZero " which is a reference to the DivideByZero Property. If vExpr is "?" then this function will return "UnknownValue" because Derive uses the question mark to represent undefined values. |