VAL (Function)

is a function which converts a string representation of a number into a numeric value. It does not evaluate expressions, so for example  will give the result  ; when the function sees a character that does not represent a number, it assumes that is the end of the number.

There are several shortcomings in the Petit Computer implementation of this function. The following are some examples.

If the string starts with " ", the function will generate an error " ".

gives, as expected, but   makes an " " error.

and  generate  s.

gives.

gives, and   gives  , as expected, but   gives.