Question
Bug with 'In-Line' definition and evaluation
- April 27, 2010
- 4 replies
- 5243 views
I have found what appears to be a bug with definition and evaluation within the same statement ("In-Line Definition and Evaluation"), if vectors are used. (This affects only MC 14 as far-as I know, as earlier versions did not support "In-Line" definition and evaluation in a single statement.)
It seems that if you define and then evaluate a vector of parameters in a single statement, and change the displayed units of the evaluation, you get incorrect results when the vector is referenced later. If you define on one line, then evaluate on a separate line (changing units in the "evaluation" statement), as per MC 13 and earlier limitations, it works fine.
See attached sample file, which replicates the same set of simple calculations, the first time not using "In-Line" definition and evaluation, the second time using "In-Line" definition and evaluation. It seems that in the second example, changing the displayed units from default "m/s" to "km/hr", changes the numerical values in the underlying vector, but does not update the units. As a result, all later references to the Velocity vector yield incorrect results.
Is this a known bug? The work-around is straight-forward enough (don't use in-line definition and evaluation of vectors), but this could be a real problem for anyone who has been using in-line definition and evaluation in any worksheets which use vectors. (Like me!)
It seems that if you define and then evaluate a vector of parameters in a single statement, and change the displayed units of the evaluation, you get incorrect results when the vector is referenced later. If you define on one line, then evaluate on a separate line (changing units in the "evaluation" statement), as per MC 13 and earlier limitations, it works fine.
See attached sample file, which replicates the same set of simple calculations, the first time not using "In-Line" definition and evaluation, the second time using "In-Line" definition and evaluation. It seems that in the second example, changing the displayed units from default "m/s" to "km/hr", changes the numerical values in the underlying vector, but does not update the units. As a result, all later references to the Velocity vector yield incorrect results.
Is this a known bug? The work-around is straight-forward enough (don't use in-line definition and evaluation of vectors), but this could be a real problem for anyone who has been using in-line definition and evaluation in any worksheets which use vectors. (Like me!)

