[LON-CAPA-users] numeric portion of a submission

Gerd Kortemeyer korte at lite.msu.edu
Thu Oct 17 08:35:40 EDT 2013


On Oct 17, 2013, at 7:54 AM, hkng <hkng at fsu.edu> wrote:

> As Gerd pointed out not an easy problem. However, Perl will automatically take the numeric part of a variable if you do a arithmetic operation. For example, if you do the following.
> $vx = $vi_submitted+1;
> $vx--;
> then $vx will be just the numeric value. Works with exp too but not something like 1.23x10^3 m/s.  

Right, LON-CAPA understands a lot that Perl does not.

But in any case, I would not do this. If certain units are expected, they should be given in the problem. Otherwise, the nature of physics is that any units with the right dimensions are appropriate.

- Gerd.

More information about the LON-CAPA-users mailing list