Anonymous user
Determine if a string is numeric: Difference between revisions
→{{header|PL/I}}
Line 1,180:
=={{header|PL/I}}==
<lang PL/I>
is_numeric: procedure (text) returns (bit (1));
declare text character (*);
declare x float;
on conversion go to done;
get string(text) edit (x) (E(length(text),0));
</lang>▼
return ('1'b);
done:
return ('0'b);
end is_numeric;</lang>
<pre>
5 '1'B
6.7 '1'B
-8.9 '1'B
-4e3 '1'B
4A37 '0'B
=={{header|PL/SQL}}==
|