Manuals >Reference >ADS Simulator Print version of this Book (PDF file) |
![]() ![]() |
||||
|
|||||
VarEqn Data TypesThe 4 basic data types that VarEqn supports are integer, real, complex, and string. There is a fifth data type, pointer, that is also supported. Pointers are not allowed in an algebraic expression, except as an argument to a function that is expecting a pointer. Strings are not allowed in algebraic expressions either except that addition of strings is equivalent to catenation of the strings. String catenation is not commutative, and since VarEqn's simplification routines can internally change the order of operands of commutative operators, this feature should be used cautiously. It will most likely be replaced by an explicit catenation function. Type conversionThe data type of a VarEqn expression is determined at the time the expression is evaluated and depends on the data types of the terms in the expression. For example, let y=3*x^2. If x is an integer, then y is integer-valued. If x is real, then y is real-valued. If x is complex, then y is complex-valued. As another example, let y=sqrt(2.5*x). If x is a positive integer, then y evaluates to a real number. If, however, x is a negative integer, then y evaluates to a complex number. There are some special cases of type conversion:
|
|||||
|
|||||
![]() ![]() |