Determine if a string is numeric: Difference between revisions

Content added Content deleted
(Added GNU APL (APL2) version)
Line 2,012: Line 2,012:
h = h
h = h
.
.
test$[] = [ "abc" "21a" "1234" "-13" "7.65" ]
for s$ in [ "abc" "21a" "1234" "-13" "7.65" ]
call is_numeric s$ r
for i range len test$[]
call is_numeric test$[i] r
if r = 1
if r = 1
print test$[i] & " is numeric"
print s$ & " is numeric"
else
else
print test$[i] & " is not numeric"
print s$ & " is not numeric"
.
.
.</lang>
.</lang>