Determine if a string is numeric: Difference between revisions
→{{header|Perl 6}}: and a few more
Thundergnat (talk | contribs) m (→{{header|Perl 6}}: test a few more edge conditions) |
Thundergnat (talk | contribs) (→{{header|Perl 6}}: and a few more) |
||
Line 2,919:
printf "%10s %8s %11s\n",
"<$_>", .&is-number-w-ws, .&is-number-wo-ws for
(|<1 1.2 1.2.3 -6 1/2 12e B17 1.3e+12 1.3e12 -2.6e-3 zero 0x 0xA10 0b1001 0o16
<pre> Coerce Don't coerce
Line 2,945:
<Inf> True True
<NaN> True True
<0x10.50> True True
<0b102> False False
<0o_5_3> True True
<1 1 1> False False
<> True False
|